Reversing the order of maybe_emit_filelist_progress() and
[rsync/rsync.git] / exclude.c
index 5351c30..ffcd0a7 100644 (file)
--- a/exclude.c
+++ b/exclude.c
@@ -131,6 +131,11 @@ static void report_exclude_result(char const *name,
         /* If a trailing slash is present to match only directories,
          * then it is stripped out by make_exclude.  So as a special
          * case we add it back in here. */
+
+       /* FIXME: At the moment if you don't specify --recursive, this
+        * seems to give messages like "excluding file
+        * mbpconfig/.Xresources because of pattern /*""/*", which is
+        * a bit confusing.  See Rusty's gross hack below. */
         
         if (verbose >= 2)
                 rprintf(FINFO, "%s %s %s because of pattern %s%s\n",
@@ -167,7 +172,7 @@ int check_exclude(char *name, struct exclude_struct **local_exclude_list,
 
        if (local_exclude_list) {
                for (n=0; local_exclude_list[n]; n++) {
-                        ent = exclude_list[n];
+                        ent = local_exclude_list[n];
                        if (check_one_exclude(name, ent, st)) {
                                 report_exclude_result(name, ent, st);
                                return !ent->include;
@@ -201,9 +206,11 @@ void add_exclude_list(const char *pattern, struct exclude_struct ***list, int in
        if (!*list || !((*list)[len] = make_exclude(pattern, include)))
                out_of_memory("add_exclude");
        
-       if (verbose > 2)
-               rprintf(FINFO,"add_exclude(%s)\n",pattern);
-       
+       if (verbose > 2) {
+               rprintf(FINFO,"add_exclude(%s,%s)\n",pattern,
+                             include ? "include" : "exclude");
+       }
+
        (*list)[len+1] = NULL;
 }
 
@@ -299,7 +306,8 @@ void send_exclude_list(int f)
 void recv_exclude_list(int f)
 {
        char line[MAXPATHLEN];
-       int l;
+       unsigned int l;
+
        while ((l=read_int(f))) {
                if (l >= MAXPATHLEN) overflow("recv_exclude_list");
                read_sbuf(f,line,l);