From 5ea5aedbf2bea94f2fad592c38f2f40d475a830f Mon Sep 17 00:00:00 2001 From: Tim Kientzle Date: Sat, 4 Jul 2009 03:19:18 -0400 Subject: [PATCH] Sync with recent changes to tar/test/main.c. No functional change. SVN-Revision: 1213 --- libarchive/test/main.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/libarchive/test/main.c b/libarchive/test/main.c index f8e66d667..fa6985a8a 100644 --- a/libarchive/test/main.c +++ b/libarchive/test/main.c @@ -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 /* -- 2.47.3