|
@@ -400,7 +400,6 @@ enum regex_type filter_parse_regex(char *buff, int len, char **search, int *not)
|
|
|
for (i = 0; i < len; i++) {
|
|
|
if (buff[i] == '*') {
|
|
|
if (!i) {
|
|
|
- *search = buff + 1;
|
|
|
type = MATCH_END_ONLY;
|
|
|
} else if (i == len - 1) {
|
|
|
if (type == MATCH_END_ONLY)
|
|
@@ -410,14 +409,14 @@ enum regex_type filter_parse_regex(char *buff, int len, char **search, int *not)
|
|
|
buff[i] = 0;
|
|
|
break;
|
|
|
} else { /* pattern continues, use full glob */
|
|
|
- type = MATCH_GLOB;
|
|
|
- break;
|
|
|
+ return MATCH_GLOB;
|
|
|
}
|
|
|
} else if (strchr("[?\\", buff[i])) {
|
|
|
- type = MATCH_GLOB;
|
|
|
- break;
|
|
|
+ return MATCH_GLOB;
|
|
|
}
|
|
|
}
|
|
|
+ if (buff[0] == '*')
|
|
|
+ *search = buff + 1;
|
|
|
|
|
|
return type;
|
|
|
}
|