--- 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) if (name->found_count || name->directory) 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) diff -urNp tar-1.23-orig/tests/exclude01.at tar-1.23/tests/exclude01.at --- tar-1.23-orig/tests/exclude01.at 2010-01-26 12:30:20.000000000 +0100 +++ tar-1.23/tests/exclude01.at 2010-03-12 14:42:31.000000000 +0100 @@ -59,6 +59,7 @@ testdir/dir2/file2 testdir/dir3/ NEXT testdir/dir1/* +testdir/dir1/file1 NEXT testdir/dir1/* NEXT