Fix --update --wildcards

* src/common.h (name): New field: is_wildcard.
(name_scan): Change protoype.
* src/delete.c: Update calls to name_scan.
* src/names.c (addname, add_starting_file): Initialize is_wildcard.
(namelist_match): Take two arguments.  If second one is true, return
only exact matches.
(name_scan): Likewise.  All callers updated.
(name_from_list): Skip patterns.
* src/update.c (remove_exact_name): New function.
(update_archive): Do not remove matching name, if it is a pattern.
Instead, add a new entry with the matching file name.

* tests/update04.at: New test.
* tests/Makefile.am: Add new test.
* tests/testsuite.at: Include new test.

* NEWS: Update.
This commit is contained in:
Sergey Poznyakoff
2023-07-10 21:09:57 +03:00
parent b3a71dbdb9
commit 10954cf163
8 changed files with 121 additions and 20 deletions

4
NEWS
View File

@@ -1,4 +1,4 @@
GNU tar NEWS - User visible changes. 2023-01-06
GNU tar NEWS - User visible changes. 2023-07-10
Please send GNU tar bug reports to <bug-tar@gnu.org>
version 1.34.90 (git)
@@ -11,6 +11,8 @@ version 1.34.90 (git)
* Bug fixes
** Fix interaction of --update with --wildcards
** Warn "file changed as we read it" less often.
Formerly, tar warned if the file's size or ctime changed.
However, this generated a false positive if tar read a file