Handle empty patterns correctly.
[rsc] --rw-rw-r-- M 771144 glenda sys 21874 Feb 11 09:16 sys/src/cmd/replica/applylog.c
/n/sourcesdump/2006/0211/plan9/sys/src/cmd/replica/applylog.c:68,73 -
/n/sourcesdump/2006/0212/plan9/sys/src/cmd/replica/applylog.c:68,75
for(i=0; i<nres; i++){
len = strlen(res[i].name);
+ if(len == 0)
+ return res[i].c;
if(strncmp(name, res[i].name, len) == 0 && (name[len]=='/' || name[len] == 0))
return res[i].c;
}
/n/sourcesdump/2006/0211/plan9/sys/src/cmd/replica/applylog.c:762,767 -
/n/sourcesdump/2006/0212/plan9/sys/src/cmd/replica/applylog.c:764,771
return 1;
for(i=0; i<nmatch; i++){
len = strlen(match[i]);
+ if(len == 0)
+ return 1;
if(strncmp(s, match[i], len) == 0 && (s[len]=='/' || s[len] == 0))
return 1;
}
|