Bug in vi + patch
Dan Moinescu
dan at moinescu.net
Fri Apr 19 17:03:32 UTC 2013
On 4/19/13, Dan Fandrich <dan at coneharvesters.com> wrote:
> On Thu, Apr 18, 2013 at 09:36:41PM +0300, Dan Moinescu wrote:
>> If busybox is configured with CONFIG_FEATURE_VI_REGEX_SEARCH=y, then
>> all searches in vi are case-sensitive, even if ":set ignorecase" is in
>> effect. The attached patch solves this problem (the code is based on
>> the example on doing case-insensitive regex searches at
>> http://www.gnu.org/software/gnulib/manual/html_node/GNU-Translate-Tables.html#GNU-Translate-Tables).
>
> This clearly won't work for extended UTF-8 characters, but does Busybox's vi even support that elsewhere?
Support for UTF-8 characters in vi isn't great to say the least (but
then again, I have serious doubts that anyone who has to do UTF-8 text
processing will rely on busybox's vi). In the standard configuration
(CONFIG_FEATURE_VI_8BIT is not set), extended characters aren't even
shown, so "française" is shown as "fran..aise". If
CONFIG_FEATURE_VI_8BIT is set, then the extended characters are shown,
but the cursor behaves oddly around them (the cursor's position in the
file is not where it appears to be on screen).
Back to the patch, you're right: it won't work for utf-8, in the sense
that if one has the text "française" in a file and searches for
"FRANÇAISE", the search will fail. But it won't cause a crash or
anything, and one can still successfully search for "FRANçAISE" or
"FRAN..AISE", which imho is still better than the current state.
More information about the busybox
mailing list