- int len=0;
- if (list && *list)
- for (; (*list)[len]; len++) ;
-
- if (strcmp(pattern,"!") == 0) {
- if (verbose > 2)
- rprintf(FINFO,"clearing exclude list\n");
- while ((len)--)
- free((*list)[len]);
- free((*list));
- *list = NULL;
- return;
- }
-
- if (!*list) {
- *list = (char **)malloc(sizeof(char *)*2);
- } else {
- *list = (char **)realloc(*list,sizeof(char *)*(len+2));
- }
-
- if (!*list || !((*list)[len] = strdup(pattern)))
- out_of_memory("add_exclude");
-
- if (verbose > 2)
- rprintf(FINFO,"add_exclude(%s)\n",pattern);
-
- (*list)[len+1] = NULL;
+ int len=0;
+ if (list && *list)
+ for (; (*list)[len]; len++) ;
+
+ if (strcmp(pattern,"!") == 0) {
+ if (verbose > 2)
+ rprintf(FINFO,"clearing exclude list\n");
+ while ((len)--) {
+ free_exclude((*list)[len]);
+ }
+ free((*list));
+ *list = NULL;
+ return;
+ }
+
+ if (!*list) {
+ *list = (struct exclude_struct **)malloc(sizeof(struct exclude_struct *)*2);
+ } else {
+ *list = (struct exclude_struct **)realloc(*list,sizeof(struct exclude_struct *)*(len+2));
+ }
+
+ if (!*list || !((*list)[len] = make_exclude(pattern, include)))
+ out_of_memory("add_exclude");
+
+ if (verbose > 2)
+ rprintf(FINFO,"add_exclude(%s)\n",pattern);
+
+ (*list)[len+1] = NULL;