if (!name[0]) return 0;
+ if (*pattern == '/' && *name != '/') pattern++;
+
if (is_regex(pattern)) {
if (fnmatch(pattern, name, 0) == 0)
return 1;
if (strcmp(pattern,"!") == 0) {
if (verbose > 2)
- fprintf(FERROR,"clearing exclude list\n");
+ rprintf(FINFO,"clearing exclude list\n");
while ((len)--)
free((*list)[len]);
free((*list));
out_of_memory("add_exclude");
if (verbose > 2)
- fprintf(FERROR,"add_exclude(%s)\n",pattern);
+ rprintf(FINFO,"add_exclude(%s)\n",pattern);
(*list)[len+1] = NULL;
}
char line[MAXPATHLEN];
if (!f) {
if (fatal) {
- fprintf(FERROR,"%s : %s\n",fname,strerror(errno));
+ rprintf(FERROR,"%s : %s\n",fname,strerror(errno));
exit_cleanup(1);
}
return list;
char line[MAXPATHLEN];
int l;
while ((l=read_int(f))) {
- read_buf(f,line,l);
- line[l] = 0;
- add_exclude(line);
+ if (l >= MAXPATHLEN) overflow("recv_exclude_list");
+ read_sbuf(f,line,l);
+ add_exclude(line);
}
}