FEATURE_VI_REGEX_SEARCH bug
Andrey Dobrovolsky
andrey.dobrovolsky.odessa at gmail.com
Sun Nov 25 19:35:45 UTC 2018
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
This error affects versions at least since 1.23, simple patches for
1.27.2 and 1.29.3 attached, I can check other versions, if necessary.
Patches must be applied to "editors/vi.c"
-------------- next part --------------
1920a1921,1922
> if (range == LIMITED)
> q = next_line(p); // range is to prev line
-------------- next part --------------
1912a1913,1914
> if (range == LIMITED)
> q = next_line(p); // range is to next line
More information about the busybox
mailing list