From: Arshan Khanifar Date: Wed, 7 Feb 2018 17:59:57 +0000 (-0500) Subject: absolute path fix X-Git-Tag: v3.3.3~18^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=64c49d77bcde1b86417ce5b4e45bd2d540f2dddd;p=thirdparty%2Flibarchive.git absolute path fix --- diff --git a/tar/test/test_option_C_mtree.c b/tar/test/test_option_C_mtree.c index fb644a411..dc2692ac9 100644 --- a/tar/test/test_option_C_mtree.c +++ b/tar/test/test_option_C_mtree.c @@ -33,19 +33,24 @@ DEFINE_TEST(test_option_C_mtree) char *p0; size_t s; int r; - p0 = NULL; - char *content = "./foo type=file uname=root gname=root mode=0755\n"; + char *filename = "output.tar"; + /* an absolute path to mtree file */ + char *mtree_file = "/METALOG.mtree"; + char *absolute_path = malloc(strlen(testworkdir) + strlen(mtree_file) + 1); + strcpy(absolute_path, testworkdir); + strcat(absolute_path, mtree_file ); + /* Create an archive using an mtree file. */ - assertMakeFile("/tmp/METALOG.mtree", 0777, content); + assertMakeFile(absolute_path, 0777, content); assertMakeDir("bar", 0775); assertMakeFile("bar/foo", 0777, "abc"); - r = systemf("%s -cf output.tar -C bar @/tmp/METALOG.mtree >step1.out 2>step1.err", testprog); + r = systemf("%s -cf %s -C bar @%s >step1.out 2>step1.err", testprog, filename, absolute_path); - failure("Error invoking %s -cf output.tar -C bar @/tmp/METALOG.mtree", testprog); + failure("Error invoking %s -cf %s -C bar @%s", testprog, filename, absolute_path); assertEqualInt(r, 0); assertEmptyFile("step1.out"); assertEmptyFile("step1.err");