summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWayne Davison <wayned@samba.org>2004-04-22 22:17:15 +0000
committerWayne Davison <wayned@samba.org>2004-04-22 22:17:15 +0000
commit9fdb334e8518d80914aa33282d718d9ee6809b30 (patch)
treefbfa562432f10da0c88819431cc4c658ca5dd66b
parentf89e890b87f1283a10069f2970820bbbe5ccfd5f (diff)
downloadrsync-9fdb334e8518d80914aa33282d718d9ee6809b30.tar.gz
Restore the old include behavior where a command-line include could
override a .cvsignore exclude.
-rw-r--r--exclude.c5
-rw-r--r--flist.c11
-rw-r--r--util.c2
3 files changed, 11 insertions, 7 deletions
diff --git a/exclude.c b/exclude.c
index 063f7335..81aaed9d 100644
--- a/exclude.c
+++ b/exclude.c
@@ -215,7 +215,8 @@ static void report_exclude_result(char const *name,
/*
* Return true if file NAME is defined to be excluded by the specified
- * exclude list.
+ * exclude list. Returns -1 for an exclude, 1 for an include, and 0 if
+ * no match.
*/
int check_exclude(struct exclude_list_struct *listp, char *name, int name_is_dir)
{
@@ -225,7 +226,7 @@ int check_exclude(struct exclude_list_struct *listp, char *name, int name_is_dir
if (check_one_exclude(name, ent, name_is_dir)) {
report_exclude_result(name, ent, name_is_dir,
listp->debug_type);
- return !ent->include;
+ return ent->include ? 1 : -1;
}
}
diff --git a/flist.c b/flist.c
index 077e42c7..bd7ad16f 100644
--- a/flist.c
+++ b/flist.c
@@ -211,6 +211,8 @@ int link_stat(const char *path, STRUCT_STAT * buffer)
*/
static int check_exclude_file(char *fname, int is_dir, int exclude_level)
{
+ int rc;
+
#if 0 /* This currently never happens, so avoid a useless compare. */
if (exclude_level == NO_EXCLUDES)
return 0;
@@ -227,14 +229,15 @@ static int check_exclude_file(char *fname, int is_dir, int exclude_level)
}
}
if (server_exclude_list.head
- && check_exclude(&server_exclude_list, fname, is_dir))
+ && check_exclude(&server_exclude_list, fname, is_dir) < 0)
return 1;
if (exclude_level != ALL_EXCLUDES)
return 0;
- if (exclude_list.head && check_exclude(&exclude_list, fname, is_dir))
- return 1;
+ if (exclude_list.head
+ && (rc = check_exclude(&exclude_list, fname, is_dir)) != 0)
+ return rc < 0;
if (local_exclude_list.head
- && check_exclude(&local_exclude_list, fname, is_dir))
+ && check_exclude(&local_exclude_list, fname, is_dir) < 0)
return 1;
return 0;
}
diff --git a/util.c b/util.c
index be639e44..34df88e3 100644
--- a/util.c
+++ b/util.c
@@ -476,7 +476,7 @@ static int exclude_server_path(char *arg)
if (server_exclude_list.head) {
for (s = arg; (s = strchr(s, '/')) != NULL; ) {
*s = '\0';
- if (check_exclude(&server_exclude_list, arg, 1)) {
+ if (check_exclude(&server_exclude_list, arg, 1) < 0) {
/* We must leave arg truncated! */
return 1;
}