mktemp: fix for dir/file.XXXXXX param (by Rob). +9 bytes.

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
Denys Vlasenko 2010-07-27 08:26:32 +02:00
parent b4d035165f
commit 06702365d7

View File

@ -50,7 +50,7 @@ int mktemp_main(int argc UNUSED_PARAM, char **argv)
opts = getopt32(argv, "dqtp:", &path);
chp = argv[optind] ? argv[optind] : xstrdup("tmp.XXXXXX");
if (chp[0] != '/' || (opts & 8))
if (!strchr(chp, '/') || (opts & 8))
chp = concat_path_file(path, chp);
if (opts & 1) { /* -d */