]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
Chdir() out of the work directory before trying to remove it.
authorTim Kientzle <kientzle@gmail.com>
Fri, 24 Jul 2009 04:39:49 +0000 (00:39 -0400)
committerTim Kientzle <kientzle@gmail.com>
Fri, 24 Jul 2009 04:39:49 +0000 (00:39 -0400)
SVN-Revision: 1273

cpio/test/main.c
libarchive/test/main.c
tar/test/main.c

index b6d0c0e67180c892177b996eddef9f47ff9c9abf..e35bd191087f0dde9fe2c85ee6e3587a570e04fb 100644 (file)
@@ -825,9 +825,9 @@ static int test_run(int i, const char *tmpdir)
        if (failures == failures_before) {
                if (!keep_temp_files && chdir(tmpdir) == 0) {
 #if defined(_WIN32) && !defined(__CYGWIN__)
-                       systemf("rmdir /S /Q %s", tests[i].name);
+                       systemf("rmdir /S /Q \"%s\"", tests[i].name);
 #else
-                       systemf("rm -rf %s", tests[i].name);
+                       systemf("rm -rf \"%s\"", tests[i].name);
 #endif
                }
        }
@@ -1194,6 +1194,7 @@ int main(int argc, char **argv)
 
        /* If the final tmpdir is empty, we can remove it. */
        /* This should be the usual case when all tests succeed. */
+       chdir("..");
        rmdir(tmpdir);
 
        return (tests_failed);
index fa6985a8abb92d3ad895d4a9dff92a0f7ba6b036..18f7df4558870130fa74e0289ffd581d5a0f5101 100644 (file)
@@ -1277,6 +1277,7 @@ int main(int argc, char **argv)
 
        /* If the final tmpdir is empty, we can remove it. */
        /* This should be the usual case when all tests succeed. */
+       chdir("..");
        rmdir(tmpdir);
 
        return (tests_failed);
index bad34d45b4b511957077d91d28f46271ed4aacfe..c4e7004ac20d033ea489c4cc80c0a45be9fcb2be 100644 (file)
@@ -1258,6 +1258,7 @@ int main(int argc, char **argv)
 
        /* If the final tmpdir is empty, we can remove it. */
        /* This should be the usual case when all tests succeed. */
+       chdir("..");
        rmdir(tmpdir);
 
        return (tests_failed);