OpenBSD CVS

CVS log for src/usr.bin/mg/re_search.c


[BACK] Up to [local] / src / usr.bin / mg

Request diff between arbitrary revisions


Default branch: MAIN
Current tag: OPENBSD_6_8_BASE


Revision 1.35 / (download) - annotate - [select for diffs], Wed Jul 22 13:29:05 2020 UTC (3 years, 10 months ago) by tb
Branch: MAIN
CVS Tags: OPENBSD_6_9_BASE, OPENBSD_6_9, OPENBSD_6_8_BASE, OPENBSD_6_8
Changes since 1.34: +9 -5 lines
Diff to previous 1.34 (colored)

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

This form allows you to request diff's between any two revisions of a file. You may select a symbolic revision name using the selection box or you may type in a numeric name using the type-in text box.