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:25:30 +03:00
parent b3a71dbdb9
commit 10954cf163
8 changed files with 121 additions and 20 deletions
+2 -2
View File
@@ -184,7 +184,7 @@ delete_archive_members (void)
abort ();
case HEADER_SUCCESS:
if ((name = name_scan (current_stat_info.file_name)) == NULL)
if ((name = name_scan (current_stat_info.file_name, false)) == NULL)
{
skim_member (acting_as_filter);
break;
@@ -279,7 +279,7 @@ delete_archive_members (void)
/* Found another header. */
xheader_decode (&current_stat_info);
if ((name = name_scan (current_stat_info.file_name)) != NULL)
if ((name = name_scan (current_stat_info.file_name, false)) != NULL)
{
name->found_count++;
if (ISFOUND (name))