1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
|
--- tar-1.17/doc/tar.texi.wildcards 2007-06-28 13:23:46.000000000 +0200
+++ tar-1.17/doc/tar.texi 2007-06-28 13:23:46.000000000 +0200
@@ -6871,7 +6871,7 @@ The following table summarizes pattern-m
@multitable @columnfractions .3 .7
@headitem Members @tab Default settings
-@item Inclusion @tab @option{--no-wildcards --anchored --no-wildcards-match-slash}
+@item Inclusion @tab @option{--wildcards --anchored --wildcards-match-slash}
@item Exclusion @tab @option{--wildcards --no-anchored --wildcards-match-slash}
@end multitable
@@ -10666,6 +10666,9 @@ version of this document is available at
@table @asis
@item Use of globbing patterns when listing and extracting.
+Note: Following is true for original unpatched GNU tar.
+For compatibility reasons, the old behavior was preserved.
+
Previous versions of GNU tar assumed shell-style globbing when
extracting from or listing an archive. For example:
--- tar-1.17/src/tar.c.wildcards 2007-06-28 13:23:46.000000000 +0200
+++ tar-1.17/src/tar.c 2007-06-28 13:23:46.000000000 +0200
@@ -686,7 +686,7 @@ static struct argp_option options[] = {
{"no-ignore-case", NO_IGNORE_CASE_OPTION, 0, 0,
N_("case sensitive matching (default)"), GRID+1 },
{"wildcards", WILDCARDS_OPTION, 0, 0,
- N_("use wildcards (default for exclusion)"), GRID+1 },
+ N_("use wildcards (default)"), GRID+1 },
{"no-wildcards", NO_WILDCARDS_OPTION, 0, 0,
N_("verbatim string matching"), GRID+1 },
{"no-wildcards-match-slash", NO_WILDCARDS_MATCH_SLASH_OPTION, 0, 0,
@@ -780,8 +780,7 @@ ARGMATCH_VERIFY (atime_preserve_args, at
/* Wildcard matching settings */
enum wildcards
{
- default_wildcards, /* For exclusion == enable_wildcards,
- for inclusion == disable_wildcards */
+ default_wildcards, /* enable_wildcards */
disable_wildcards,
enable_wildcards
};
@@ -809,7 +808,7 @@ struct tar_args /* Variables used
| recursion_option)
#define MAKE_INCL_OPTIONS(args) \
- ((((args)->wildcards == enable_wildcards) ? EXCLUDE_WILDCARDS : 0) \
+ ((((args)->wildcards != disable_wildcards) ? EXCLUDE_WILDCARDS : 0) \
| (args)->include_anchored \
| (args)->matching_flags \
| recursion_option)
@@ -2126,7 +2125,7 @@ decode_options (int argc, char **argv)
/* Warn about implicit use of the wildcards in command line arguments.
See TODO */
- warn_regex_usage = args.wildcards == default_wildcards;
+ warn_regex_usage = 0; //args.wildcards == default_wildcards;
/* Derive option values and check option consistency. */
--- tar-1.17/src/names.c.wildcards 2007-04-03 14:17:13.000000000 +0200
+++ tar-1.17/src/names.c 2007-06-28 13:30:48.000000000 +0200
@@ -812,10 +812,7 @@ collect_and_sort_names (void)
next_name = name->next;
if (name->found_count || name->dir_contents)
continue;
- if (name->matching_flags & EXCLUDE_WILDCARDS)
- /* NOTE: EXCLUDE_ANCHORED is not relevant here */
- /* FIXME: just skip regexps for now */
- continue;
+
chdir_do (name->change_dir);
if (name->name[0] == 0)
continue;
|