CVSROOT:        /cvs
Module name:    src
Changes by:     t...@cvs.openbsd.org    2020/07/22 07:29:05

Modified files:
        usr.bin/mg     : re_search.c 

Log message:
Avoid running out of memory with query-replace-regex ^

Choosing ! (replace rest) never advances beyond the current line
and keeps inserting the replacement test, and mg eventually runs
out of memory.

Patch from Mark Willson with minor stylistic tweaks.

Looks good to Hiltjo Posthuma who would have preferred making forward
replacing on empty lines work. Mark argued that this makes it behave
consistently with the current behaviour when searching for ^ and the
point at the beginning of a non-empty line in which case the cursor does
not move either.

Also tested by krw

Reply via email to