]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
Sync with recent changes to tar/test/main.c. No functional change.
authorTim Kientzle <kientzle@gmail.com>
Sat, 4 Jul 2009 07:19:18 +0000 (03:19 -0400)
committerTim Kientzle <kientzle@gmail.com>
Sat, 4 Jul 2009 07:19:18 +0000 (03:19 -0400)
SVN-Revision: 1213

libarchive/test/main.c

index f8e66d667acfd11792161643647688269ffeaf97..fa6985a8abb92d3ad895d4a9dff92a0f7ba6b036 100644 (file)
@@ -1051,9 +1051,6 @@ int main(int argc, char **argv)
        int i, tests_run = 0, tests_failed = 0, option;
        time_t now;
        char *refdir_alloc = NULL;
-#if defined(_WIN32) && !defined(__CYGWIN__)
-       char *testprg;
-#endif
        const char *progname;
        const char *tmp, *option_arg, *p;
        char tmpdir[256];
@@ -1166,18 +1163,20 @@ int main(int argc, char **argv)
 #ifdef PROGRAM
        if (testprog == NULL)
                usage(progname);
-#endif
 #if defined(_WIN32) && !defined(__CYGWIN__)
        /*
         * command.com cannot accept the command used '/' with drive
         * name such as c:/xxx/command.exe when use '|' pipe handling.
         */
-       testprg = strdup(testprog);
-       for (i = 0; testprg[i] != '\0'; i++) {
-               if (testprg[i] == '/')
-                       testprg[i] = '\\';
+       {
+               char *testprg = strdup(testprog);
+               for (i = 0; testprg[i] != '\0'; i++) {
+                       if (testprg[i] == '/')
+                               testprg[i] = '\\';
+               }
+               testprog = testprg;
        }
-       testprog = testprg;
+#endif
 #endif
 
        /*