X-Git-Url: https://mattmccutchen.net/rsync/rsync.git/blobdiff_plain/5e972dcf34df59af1ba5ffd91b6ca278de22b847..e51094b7210fc31fa67cc218c1bd30de841a426e:/exclude.c diff --git a/exclude.c b/exclude.c index 78d9c8ce..49adcff6 100644 --- a/exclude.c +++ b/exclude.c @@ -84,14 +84,14 @@ static void make_exclude(struct exclude_list_struct *listp, const char *pat, for (cp = ret->pattern; (cp = strchr(cp, '/')) != NULL; cp++) ret->slash_cnt++; + ret->match_flags = mflags; + if (!listp->tail) listp->head = listp->tail = ret; else { listp->tail->next = ret; listp->tail = ret; } - - ret->match_flags = mflags; } static void free_exclude(struct exclude_struct *ex) @@ -100,7 +100,7 @@ static void free_exclude(struct exclude_struct *ex) free(ex); } -void free_exclude_list(struct exclude_list_struct *listp) +void clear_exclude_list(struct exclude_list_struct *listp) { struct exclude_struct *ent, *next; @@ -303,7 +303,7 @@ void add_exclude(struct exclude_list_struct *listp, const char *pattern, "[%s] clearing %sexclude list\n", who_am_i(), listp->debug_type); } - free_exclude_list(listp); + clear_exclude_list(listp); continue; }