Re: mg: segmentation fault when using query-replace-regexp

2020-07-22 Thread Theo Buehler
> Thanks very much for your review. 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. This

Re: mg: segmentation fault when using query-replace-regexp

2020-07-21 Thread Kenneth R Westerback
On Tue, Jul 21, 2020 at 05:33:39PM +0200, Theo Buehler wrote: > > Hmm. I get neither a seg fault nor a loop on my amd64 Lenove E595. The > > cursor moves to different spots in X/i3 xterm vs console and in either > > case doesn't do any replacement. > > I can reproduce both behaviors reliably as

Re: mg: segmentation fault when using query-replace-regexp

2020-07-21 Thread Mark Willson
> -Original Message- > From: Hiltjo Posthuma > Sent: 21 July 2020 10:56 > > Index: re_search.c > > === > > RCS file: /var/cvs/src/usr.bin/mg/re_search.c,v > > retrieving revision 1.34 > > diff -u -p -r1.34 re_search.c > >

Re: mg: segmentation fault when using query-replace-regexp

2020-07-21 Thread Theo Buehler
> Hmm. I get neither a seg fault nor a loop on my amd64 Lenove E595. The > cursor moves to different spots in X/i3 xterm vs console and in either > case doesn't do any replacement. I can reproduce both behaviors reliably as follows both on console and in xterm. $ echo 'a\n\n\nb' > /tmp/test $ mg

Re: mg: segmentation fault when using query-replace-regexp

2020-07-21 Thread Kenneth R Westerback
On Tue, Jul 21, 2020 at 11:55:39AM +0200, Hiltjo Posthuma wrote: > On Mon, Jul 20, 2020 at 10:11:46PM +0200, Theo Buehler wrote: > > On Mon, Jul 13, 2020 at 03:47:13PM +0100, Mark Willson wrote: > > > Folks, > > > > > > The segmentation fault occurs when the string to replace is just the > > >

Re: mg: segmentation fault when using query-replace-regexp

2020-07-21 Thread Mark Willson
> -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

Re: mg: segmentation fault when using query-replace-regexp

2020-07-21 Thread Hiltjo Posthuma
On Mon, Jul 20, 2020 at 10:11:46PM +0200, Theo Buehler wrote: > On Mon, Jul 13, 2020 at 03:47:13PM +0100, Mark Willson wrote: > > Folks, > > > > The segmentation fault occurs when the string to replace is just the > > "^" anchor (beginning-of-line) and the point is on an empty line. > > Issue

Re: mg: segmentation fault when using query-replace-regexp

2020-07-20 Thread Theo Buehler
On Mon, Jul 13, 2020 at 03:47:13PM +0100, Mark Willson wrote: > Folks, > > The segmentation fault occurs when the string to replace is just the > "^" anchor (beginning-of-line) and the point is on an empty line. > Issue occurs on a -current system dated July 11th. (dmesg below). > > The

mg: segmentation fault when using query-replace-regexp

2020-07-13 Thread Mark Willson
Folks, The segmentation fault occurs when the string to replace is just the "^" anchor (beginning-of-line) and the point is on an empty line. Issue occurs on a -current system dated July 11th. (dmesg below). The following patch prevents the segmentation fault: --- /usr/src/usr.bin/mg/line.c