]> git.ipfire.org Git - thirdparty/tar.git/commit - src/delete.c
Fix --update --wildcards
authorSergey Poznyakoff <gray@gnu.org>
Mon, 10 Jul 2023 18:09:57 +0000 (21:09 +0300)
committerSergey Poznyakoff <gray@gnu.org>
Mon, 10 Jul 2023 18:25:30 +0000 (21:25 +0300)
commit10954cf16399d5e7d846ff4fedb9b7d0240fcb9c
tree8ef236e3a694d2cc3eb8786f149d84155676df15
parentb3a71dbdb9b8472fb185b28d4ae026da08d838ca
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.
NEWS
src/common.h
src/delete.c
src/names.c
src/update.c
tests/Makefile.am
tests/testsuite.at
tests/update04.at [new file with mode: 0644]