Folks,
Of course, my patch was wrong. Insufficient testing with ³unimportant²
conditions. Sorry, guys.
The issue was with point (3), where the original patch skipped valid
matches when searching backwards. The patch below appears to be more
robust:
--- a/re_search.c Tue Apr 10 15:36:48
.a) swap on sd0b dump on sd0b
fd0 at fdc0 drive 0: 1.44MB 80 cyl, 2 head, 18 sec
fd1 at fdc0 drive 1: density unknown
acpi0: PM1 stuck (en 0x101 st 0x1), clearing
Thanks,
-mark
--
Mark Willson
mark.will...@hydrus.org.uk
https://hydrus.org.uk
> -Original Message-
> From: Theo Buehler
> Sent: 20 July 2020 21:12
> To: Mark Willson
> Cc: bugs@openbsd.org; hil...@codemadness.org
> Subject: Re: mg: segmentation fault when using query-replace-regexp
>
> On Mon, Jul 13, 2020 at 03:47:13PM +0100, Mark
view. What you point out above is certainly
true, but
then it is consistent with the current behaviour when searching for the
beginning-of-line ('^') anchor and the point at the beginning of a
non-empty line. In that case, the point does not move.
-mark
--
Mark Willson
mark.will...@hydrus.org.uk
https://hydrus.org.uk
csibus5 at softraid0: 256 targets
root on sd0a (7f9b785a6981db5a.a) swap on sd0b dump on sd0b
fd0 at fdc0 drive 0: 1.44MB 80 cyl, 2 head, 18 sec
fd1 at fdc0 drive 1: density unknown
acpi0: PM1 stuck (en 0x101 st 0x1), clearing
Best Regards,
Mark
--
Mark Willson
mark.will...@hydrus.org.uk
https://hydrus.org.uk
file are
Best Regards,
Mark
--
Mark Willson
a small defect, but I think that's a better
outcome than an endless loop.
Best Regards,
Mark
--
Mark Willson | Email: mark.will...@hydrus.org.uk
Hi Folks,
The mg command 'regexp-replace "^.*$" ""' enters an endless loop (until
memory exhausted). This behaviour also occurs in query-replace-regexp
with the "!" option.
This is due to a change I suggested to re_forwsrch, that is, not moving
dot when the line is empty (re_search.c 1.35). The
t;w_bufp->b_tabw) != 0 && linsert(n, ' ') ==
FALSE)
return (FALSE);
return (TRUE);
}
Best Regards,
Mark
--
Mark Willson
mark.will...@hydrus.org.uk
tbo = 0;
}
+ }
+ else if (tbo < 0) {
+ /* Don't advance to the next line when dot on empty line;
+* reset tbo to correct value.
+*/
+ tbo = 0;
+ }
+
/*
* Note this loop does not process the last
* beginning of next line, unless at end of file.
*/
- if (clp != curbp->b_headp && llength(clp) != 0) {
+ if (clp != curbp->b_headp) {
clp = lforw(clp);
tdotline++;
tbo = 0;
--
Mark Willson
mark.will...@hydrus.org.uk
11 matches
Mail list logo