]> git.gag.com Git - debian/tar/commit
Fix handling of filename-selection options.
authorSergey Poznyakoff <gray@gnu.org>
Thu, 10 Dec 2015 22:37:17 +0000 (00:37 +0200)
committerSergey Poznyakoff <gray@gnu.org>
Thu, 10 Dec 2015 22:50:23 +0000 (00:50 +0200)
commit4cf2af45007b5288dae1037baffa681d37c0b1c2
tree8eef0ccbf280c0c7bebef41fae884e336f2060b0
parentcadc43ace580a1be9894c5ea44abec523b474f8e
Fix handling of filename-selection options.

Filename-selection options are --wildcards, --recursive, etc. (see
names.c for a complete list).  These options are position-sensitive,
i.e. each such option affects all filenames and filename-selection
options that appear after it until eventually cancelled by a
corresponding counterpart option.

These options can appear in "file-from" file lists, which means that
they cannot be handled right away, but instead should be put on
the "name_elt" list and processed sequentionally, as file name arguments
are.

* src/common.h (warn_regex_usage): Remove.
(name_add_name): Change signature.
(name_add_dir, name_add_file): Remove prototypes.
* src/names.c (name_add_option, name_add_dir)
(name_add_file): Static functions.
(names_options, is_file_selection_option, names_parse_opt): Static functions.
(names_argp_children): New variable.
(NELT_NAME, NELT_CHDIR)
(NELT_FILE, NELT_NOOP): Redefine as enum nelt_type.
(NELT_FMASK): Remove.
(NELT_OPTION): New constant.
(name_elt) <type>: Change type.
<v.opt>: New member.
(name_elt_alloc_matflags): Remove.
(name_add_name): Take one argument.
(name_add_option): New static function.
(name_add_file): Take one argument.
(read_next_name): Use filename_terminator and
verbatim_files_from_option to initialize file.term and file.verbatim.
* src/tar.c: Move handling of filename-selection options to names.c

* tests/T-dir00.at: Fix typo.
* tests/T-recurse.at: Remove expected failure.
src/common.h
src/names.c
src/tar.c
tests/T-dir00.at
tests/T-recurse.at