HomeFreeBSD

mktemp: don't double up on trailing slashes for -t paths

Description

mktemp: don't double up on trailing slashes for -t paths

This is a minor cosmetic change; re-organize slightly to set tmpdir to
_PATH_TMP if we didn't otherwise have a tmpdir candidate, then check the
trailing char before appending another slash.

While we're here, remove some bogus whitespace and add a test case for
this change.

Obtained from: https://github.com/apple-oss-distributions/shell_cmds
Sponsored by: Klara, Inc.

Details

Provenance
kevansAuthored on Nov 2 2022, 8:29 PM
Parents
rG5cc5c9254da0: Make SYNOPSIS match DESCRIPTION.
Branches
Unknown
Tags
Unknown