mirror of
https://git.savannah.gnu.org/git/tar.git
synced 2026-09-20 07:04:14 +00:00
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:
+2
-2
@@ -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 (¤t_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))
|
||||
|
||||
Reference in New Issue
Block a user