]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
build fail fix, simplified logic
authorArshan Khanifar <arshankhanifar@gmail.com>
Tue, 6 Feb 2018 22:00:51 +0000 (17:00 -0500)
committerArshan Khanifar <arshankhanifar@gmail.com>
Tue, 6 Feb 2018 22:00:51 +0000 (17:00 -0500)
tar/test/test_option_C_mtree.c
tar/write.c

index 87f9add1efdf5107dfbdad3baea578eca3de7cb7..fb644a411e8bfe71d9f7347efc0388241eb80fb7 100644 (file)
@@ -1,5 +1,5 @@
 /*-
- * Copyright (c) 2007-2018 The FreeBSD Foundation
+ * Copyright (c) 2018 The FreeBSD Foundation
  * All rights reserved.
  * 
  * This software was developed by Arshan Khanifar <arshankhanifar@gmail.com>
@@ -61,8 +61,6 @@ DEFINE_TEST(test_option_C_mtree)
        assertEqualMem(p0 + 512, "abc", 3);
        assertEqualMem(p0 + 1024, "\0\0\0\0\0\0\0\0", 8);
        assertEqualMem(p0 + 1536, "\0\0\0\0\0\0\0\0", 8);
-
-       free(p0);
 done:
        free(p0);
 }
index 3cb1be55be743bf6e31b2ddb86f5d5e425b2eadf..e15cc06ccfc4d9ec62ecd9799594df8c2519f852 100644 (file)
@@ -503,10 +503,9 @@ write_archive(struct archive *a, struct bsdtar *bsdtar)
                        }
                        set_chdir(bsdtar, arg);
                } else {
-                       if (*arg != '/' && (arg[0] != '@' || arg[1] != '/'))
+                       if (*arg != '/')
                                do_chdir(bsdtar); /* Handle a deferred -C */
                        if (*arg == '@') {
-                               do_chdir(bsdtar); /* Handle a deferred -C */
                                if (append_archive_filename(bsdtar, a,
                                    arg + 1) != 0)
                                        break;