Fix the --exclude-backups option.

* src/tar.c (add_exclude_array): Take exclude option filags in its
second argument.
(parse_opt): Register backup_file_table with the EXCLUDE_WILDCARDS flag.
* tests/exclude07.at: New testcase.
* tests/Makefile.am (TESTSUITE_AT): Add testsuite.at.
* tests/testsuite.at: Include exclude07.at.
This commit is contained in:
Sergey Poznyakoff
2011-07-30 18:26:38 +03:00
parent 49bd102a1b
commit fa307a6655
4 changed files with 40 additions and 4 deletions
+4 -4
View File
@@ -892,12 +892,12 @@ static char const * const backup_file_table[] = {
};
static void
add_exclude_array (char const * const * fv)
add_exclude_array (char const * const * fv, int options)
{
int i;
for (i = 0; fv[i]; i++)
add_exclude (excluded, fv[i], 0);
add_exclude (excluded, fv[i], options);
}
@@ -1769,7 +1769,7 @@ parse_opt (int key, char *arg, struct argp_state *state)
break;
case EXCLUDE_BACKUPS_OPTION:
add_exclude_array (backup_file_table);
add_exclude_array (backup_file_table, EXCLUDE_WILDCARDS);
break;
case EXCLUDE_OPTION:
@@ -1804,7 +1804,7 @@ parse_opt (int key, char *arg, struct argp_state *state)
break;
case EXCLUDE_VCS_OPTION:
add_exclude_array (vcs_file_table);
add_exclude_array (vcs_file_table, 0);
break;
case FORCE_LOCAL_OPTION: