version 1.9 | | version 1.10 |
---|
| | |
/* | | /* |
* static char *rcsid_player_c = | | * static char *rcsid_player_c = |
* "$Id: re-cmp.c,v 1.9 2003/09/13 05:01:30 mwedel Exp $"; | | * "$Id: re-cmp.c,v 1.10 2004/12/29 08:45:07 mwedel Exp $"; |
*/ | | */ |
| | |
| | |
| | |
return str; | | return str; |
break; | | break; |
} | | } |
| | /* The logic here is that re_match_token only sees |
| | * if the one letter matches. Thus, if the |
| | * regex is like '@match eureca', and the |
| | * the user enters anything with an e, re_match_token |
| | * returns true, but they really need to match the |
| | * entire regexp, which re_cmp_step will do. |
| | * However, what happens is that there can be a case |
| | * where the string being match is something like |
| | * 'where is eureca'. In this case, the re_match_token |
| | * matches that first e, but the re_cmp_step below, |
| | * fails because the next character (r) doesn't match |
| | * the u. So we call re_cmp with the string |
| | * after the first r, so that it should hopefully match |
| | * up properly. |
| | */ |
if (re_cmp_step(str+1, next_regexp, 1, 0)) | | if (re_cmp_step(str+1, next_regexp, 1, 0)) |
return str; | | return str; |
| | else if (str+1 != 0) |
| | return re_cmp(str+1, regexp); |
} | | } |
return NULL; | | return NULL; |
} | | } |
| | |
++matches; | | ++matches; |
| | |
if (*str == 0) | | if (*str == 0) |
return (*next_regexp == 0 || re_token[slot]->type == sel_end); | | return (*next_regexp == 0 || re_token[slot]->type == sel_end) && matched; |
| | |
switch (re_token[slot]->repeat) { | | switch (re_token[slot]->repeat) { |
case rep_once: | | case rep_once: |