version 1.12, 2001/09/18 13:52:58 |
version 1.13, 2001/09/27 12:35:20 |
|
|
const char *last_match = NULL; |
const char *last_match = NULL; |
|
|
while ((error = regexec(re, string, re->re_nsub+1, pm, flags)) == 0) { |
while ((error = regexec(re, string, re->re_nsub+1, pm, flags)) == 0) { |
flags = REG_NOTBOL; |
if (pm[0].rm_eo != 0) { |
|
if (string[pm[0].rm_eo-1] == '\n') |
|
flags = 0; |
|
else |
|
flags = REG_NOTBOL; |
|
} |
|
|
/* NULL length matches are special... We use the `vi-mode' |
/* NULL length matches are special... We use the `vi-mode' |
* rule: don't allow a NULL-match at the last match |
* rule: don't allow a NULL-match at the last match |
|
|
if (*string == '\0') |
if (*string == '\0') |
return; |
return; |
addchar(*string); |
addchar(*string); |
string++; |
if (*string++ == '\n') |
|
flags = 0; |
|
else |
|
flags = REG_NOTBOL; |
continue; |
continue; |
} |
} |
last_match = string + pm[0].rm_so; |
last_match = string + pm[0].rm_so; |