vi: fix FEATURE_VI_REGEX_SEARCH to respect LIMITED (one-line) search
authorDenys Vlasenko <vda.linux@googlemail.com>
Thu, 29 Nov 2018 13:19:57 +0000 (14:19 +0100)
committerDenys Vlasenko <vda.linux@googlemail.com>
Thu, 29 Nov 2018 13:19:57 +0000 (14:19 +0100)
commit836d0a7ee450893e7479b5f93a501454582955a2
tree07a9de8a7d00a43c48bfe0123386c3179ad0e67b
parent9a2b6dcc2d3298499b88aea3b04c967f2f9ae965
vi: fix FEATURE_VI_REGEX_SEARCH to respect LIMITED (one-line) search

If busybox is compiled with FEATURE_VI_REGEX_SEARCH enabled, command
":s/x/y/" searches not only in the current line, but continues search
after it. This makes range searches (":1,3s/x/y/") work incorrect. For
example file "./test":
1
2
3

$ vi ./test
:1,2s/3/e/
gives us:
1
2
e

function                                             old     new   delta
char_search                                          213     241     +28

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
editors/vi.c