From 9b32b6ec3040da1748484acdf00147596ff46fb9 Mon Sep 17 00:00:00 2001 From: Arshan Khanifar Date: Tue, 6 Feb 2018 17:00:51 -0500 Subject: [PATCH] build fail fix, simplified logic --- tar/test/test_option_C_mtree.c | 4 +--- tar/write.c | 3 +-- 2 files changed, 2 insertions(+), 5 deletions(-) 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; -- 2.47.2