mktemp: fix for dir/file.XXXXXX param (by Rob). +9 bytes.
authorDenys Vlasenko <vda.linux@googlemail.com>
Tue, 27 Jul 2010 06:26:32 +0000 (08:26 +0200)
committerDenys Vlasenko <vda.linux@googlemail.com>
Tue, 27 Jul 2010 06:26:32 +0000 (08:26 +0200)
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
debianutils/mktemp.c

index 2c4e196..7ce9f10 100644 (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 */