From: Sergey Poznyakoff Date: Thu, 9 Nov 2017 06:59:36 +0000 (+0200) Subject: Fix --verbatim-files-from X-Git-Tag: release_1_30~14 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=dee7e3f16e74e07504bb8f4d80426005fe4364ae;p=thirdparty%2Ftar.git Fix --verbatim-files-from * src/names.c (read_next_name): Don't unquote name read from the file, if --verbatim-files-from option is in effect. (names_options): improve description of --verbatim-files-from * tests/T-null2.at: Test the change. --- diff --git a/src/names.c b/src/names.c index d14b524a..bd1e44e3 100644 --- a/src/names.c +++ b/src/names.c @@ -84,7 +84,7 @@ static struct argp_option names_options[] = { {"no-unquote", NO_UNQUOTE_OPTION, 0, 0, N_("do not unquote input file or member names"), GRID+1 }, {"verbatim-files-from", VERBATIM_FILES_FROM_OPTION, 0, 0, - N_("-T reads file names verbatim (no option handling)"), GRID+1 }, + N_("-T reads file names verbatim (no escape or option handling)"), GRID+1 }, {"no-verbatim-files-from", NO_VERBATIM_FILES_FROM_OPTION, 0, 0, N_("-T treats file names starting with dash as options (default)"), GRID+1 }, @@ -1027,12 +1027,15 @@ read_next_name (struct name_elt *ent, struct name_elt *ret) ent->v.file.term = 0; /* fall through */ case file_list_success: - if (unquote_option) - unquote_string (name_buffer); - if (!ent->v.file.verbatim && handle_option (name_buffer, ent) == 0) + if (!ent->v.file.verbatim) { - name_list_adjust (); - return 1; + if (unquote_option) + unquote_string (name_buffer); + if (handle_option (name_buffer, ent) == 0) + { + name_list_adjust (); + return 1; + } } ret->type = NELT_NAME; ret->v.name = name_buffer; diff --git a/tests/T-null2.at b/tests/T-null2.at index 6ab8d5b3..b3c4e44b 100644 --- a/tests/T-null2.at +++ b/tests/T-null2.at @@ -25,11 +25,13 @@ AT_TAR_CHECK([ AT_DATA([file-list],[a -b --c d +:\\.jpg ]) genfile -f a genfile -f -b genfile -f '--c d' +genfile -f ':\\.jpg' cat file-list | tr '\n' '\0' | tar -c -f archive -v --null -T - ], @@ -37,6 +39,7 @@ cat file-list | tr '\n' '\0' | tar -c -f archive -v --null -T - [a -b --c d +:\\\\.jpg ], [],[],[],[ustar]) # Testing one format is enough