From: Arshan Khanifar Date: Tue, 6 Feb 2018 22:00:51 +0000 (-0500) Subject: build fail fix, simplified logic X-Git-Tag: v3.3.3~18^2~3 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=9b32b6ec3040da1748484acdf00147596ff46fb9;p=thirdparty%2Flibarchive.git build fail fix, simplified logic --- diff --git a/tar/test/test_option_C_mtree.c b/tar/test/test_option_C_mtree.c index 87f9add1e..fb644a411 100644 --- a/tar/test/test_option_C_mtree.c +++ b/tar/test/test_option_C_mtree.c @@ -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 @@ -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); } diff --git a/tar/write.c b/tar/write.c index 3cb1be55b..e15cc06cc 100644 --- a/tar/write.c +++ b/tar/write.c @@ -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;