well as single-line ones. This avoids a segfault when trying
to color e.g. "start="$" end="$"". (DLR, found by Trevor
Caira)
+ - Don't display any statusbar message when we get a zero-length
+ regex, as we can get one under legitimate circumstances. (DLR,
+ found by Mike Frysinger)
update_line()
- Remove unneeded assert. (DLR)
edit_redraw()
* line. */
startmatch.rm_so += k;
startmatch.rm_eo += k;
- if (startmatch.rm_so == startmatch.rm_eo) {
+
+ /* Skip over a zero-length regex match. */
+ if (startmatch.rm_so == startmatch.rm_eo)
startmatch.rm_eo++;
- statusbar(
- _("Refusing zero-length regex match"));
- } else if (startmatch.rm_so < endpos &&
+ else if (startmatch.rm_so < endpos &&
startmatch.rm_eo > startpos) {
x_start = (startmatch.rm_so <= startpos) ? 0 :
strnlenpt(fileptr->data,
goto step_two;
start_line = start_line->prev;
}
- if (startmatch.rm_so == startmatch.rm_eo) {
+
+ /* Skip over a zero-length regex match. */
+ if (startmatch.rm_so == startmatch.rm_eo)
startmatch.rm_eo++;
- statusbar(_("Refusing zero-length regex match"));
- } else {
+ else {
/* No start found, so skip to the next step. */
if (start_line == NULL)
goto step_two;