- return;
- }
-
- if (list)
- for ( ; list[list_len]; list_len++) {}
-
- list = *listp = realloc_array(list, struct exclude_struct *,
- list_len + add_cnt + 1);
- if (!list)
- out_of_memory("add_exclude");
-
- while (pat_len) {
- list[list_len++] = make_exclude(cp, pat_len, incl);
-
- if (verbose > 2) {
- rprintf(FINFO, "[%s] add_exclude(%s,%s)\n",
- who_am_i(), cp,
- incl ? "include" : "exclude");
+ break;
+ /* If we got the special "!" token, clear the list. */
+ if (incl < 0)
+ free_exclude_list(listp);
+ else {
+ make_exclude(listp, cp, pat_len, incl);
+
+ if (verbose > 2) {
+ rprintf(FINFO, "[%s] add_exclude(%.*s, %s%s)\n",
+ who_am_i(), pat_len, cp,
+ listp->debug_type,
+ incl ? "include" : "exclude");
+ }