|
|
b77676 |
diff --git a/doc/tar.texi b/doc/tar.texi
|
|
|
b77676 |
index db8f986..d70d113 100644
|
|
|
b77676 |
--- a/doc/tar.texi
|
|
|
b77676 |
+++ b/doc/tar.texi
|
|
|
b77676 |
@@ -7597,7 +7597,7 @@ The following table summarizes pattern-matching default values:
|
|
|
b77676 |
|
|
|
b77676 |
@multitable @columnfractions .3 .7
|
|
|
b77676 |
@headitem Members @tab Default settings
|
|
|
b77676 |
-@item Inclusion @tab @option{--no-wildcards --anchored --no-wildcards-match-slash}
|
|
|
b77676 |
+@item Inclusion @tab @option{--wildcards --anchored --wildcards-match-slash}
|
|
|
b77676 |
@item Exclusion @tab @option{--wildcards --no-anchored --wildcards-match-slash}
|
|
|
b77676 |
@end multitable
|
|
|
b77676 |
|
|
|
b77676 |
@@ -12038,6 +12038,9 @@ version of this document is available at
|
|
|
b77676 |
@table @asis
|
|
|
b77676 |
@item Use of globbing patterns when listing and extracting.
|
|
|
b77676 |
|
|
|
b77676 |
+Note: Following is true for original unpatched GNU tar.
|
|
|
b77676 |
+For compatibility reasons, the old behavior was preserved.
|
|
|
b77676 |
+
|
|
|
b77676 |
Previous versions of GNU tar assumed shell-style globbing when
|
|
|
b77676 |
extracting from or listing an archive. For example:
|
|
|
b77676 |
|
|
|
b77676 |
diff --git a/src/names.c b/src/names.c
|
|
|
b77676 |
index ba4d509..3911f8c 100644
|
|
|
b77676 |
--- a/src/names.c
|
|
|
b77676 |
+++ b/src/names.c
|
|
|
b77676 |
@@ -966,10 +966,7 @@ collect_and_sort_names (void)
|
|
|
b77676 |
|
|
|
b77676 |
if (name->found_count || name->directory)
|
|
|
b77676 |
continue;
|
|
|
b77676 |
- if (name->matching_flags & EXCLUDE_WILDCARDS)
|
|
|
b77676 |
- /* NOTE: EXCLUDE_ANCHORED is not relevant here */
|
|
|
b77676 |
- /* FIXME: just skip regexps for now */
|
|
|
b77676 |
- continue;
|
|
|
b77676 |
+
|
|
|
b77676 |
chdir_do (name->change_dir);
|
|
|
b77676 |
|
|
|
b77676 |
if (name->name[0] == 0)
|
|
|
b77676 |
diff --git a/src/tar.c b/src/tar.c
|
|
|
b77676 |
index 928cfdd..22d3db1 100644
|
|
|
b77676 |
--- a/src/tar.c
|
|
|
b77676 |
+++ b/src/tar.c
|
|
|
b77676 |
@@ -722,7 +722,7 @@ static struct argp_option options[] = {
|
|
|
b77676 |
{"no-ignore-case", NO_IGNORE_CASE_OPTION, 0, 0,
|
|
|
b77676 |
N_("case sensitive matching (default)"), GRID+1 },
|
|
|
b77676 |
{"wildcards", WILDCARDS_OPTION, 0, 0,
|
|
|
b77676 |
- N_("use wildcards (default for exclusion)"), GRID+1 },
|
|
|
b77676 |
+ N_("use wildcards (default)"), GRID+1 },
|
|
|
b77676 |
{"no-wildcards", NO_WILDCARDS_OPTION, 0, 0,
|
|
|
b77676 |
N_("verbatim string matching"), GRID+1 },
|
|
|
b77676 |
{"no-wildcards-match-slash", NO_WILDCARDS_MATCH_SLASH_OPTION, 0, 0,
|
|
|
b77676 |
@@ -815,8 +815,7 @@ ARGMATCH_VERIFY (atime_preserve_args, atime_preserve_types);
|
|
|
b77676 |
/* Wildcard matching settings */
|
|
|
b77676 |
enum wildcards
|
|
|
b77676 |
{
|
|
|
b77676 |
- default_wildcards, /* For exclusion == enable_wildcards,
|
|
|
b77676 |
- for inclusion == disable_wildcards */
|
|
|
b77676 |
+ default_wildcards, /* enable_wildcards */
|
|
|
b77676 |
disable_wildcards,
|
|
|
b77676 |
enable_wildcards
|
|
|
b77676 |
};
|
|
|
b77676 |
@@ -847,7 +846,7 @@ struct tar_args /* Variables used during option parsing */
|
|
|
b77676 |
| recursion_option)
|
|
|
b77676 |
|
|
|
b77676 |
#define MAKE_INCL_OPTIONS(args) \
|
|
|
b77676 |
- ((((args)->wildcards == enable_wildcards) ? EXCLUDE_WILDCARDS : 0) \
|
|
|
b77676 |
+ ((((args)->wildcards != disable_wildcards) ? EXCLUDE_WILDCARDS : 0) \
|
|
|
b77676 |
| (args)->include_anchored \
|
|
|
b77676 |
| (args)->matching_flags \
|
|
|
b77676 |
| recursion_option)
|
|
|
b77676 |
@@ -2347,7 +2346,7 @@ decode_options (int argc, char **argv)
|
|
|
b77676 |
|
|
|
b77676 |
/* Warn about implicit use of the wildcards in command line arguments.
|
|
|
b77676 |
See TODO */
|
|
|
b77676 |
- warn_regex_usage = args.wildcards == default_wildcards;
|
|
|
b77676 |
+ warn_regex_usage = 0; /* args.wildcards == default_wildcards; */
|
|
|
b77676 |
|
|
|
b77676 |
/* Derive option values and check option consistency. */
|
|
|
b77676 |
|
|
|
b77676 |
diff --git a/tests/exclude01.at b/tests/exclude01.at
|
|
|
b77676 |
index 778a7fc..bd65ae0 100644
|
|
|
b77676 |
--- a/tests/exclude01.at
|
|
|
b77676 |
+++ b/tests/exclude01.at
|
|
|
b77676 |
@@ -59,6 +59,7 @@ testdir/dir2/file2
|
|
|
b77676 |
testdir/dir3/
|
|
|
b77676 |
NEXT
|
|
|
b77676 |
testdir/dir1/*
|
|
|
b77676 |
+testdir/dir1/file1
|
|
|
b77676 |
NEXT
|
|
|
b77676 |
testdir/dir1/*
|
|
|
b77676 |
NEXT
|