You can't spell "evil" without "vi".

Denys Vlasenko vda.linux at googlemail.com
Tue Oct 14 09:24:03 UTC 2008


On Monday 13 October 2008 06:48:22 am Rob Landley wrote:
> If you use the cursor keys in vi, it adds three characters at a time.  (The 
> ansi "move cursor" sequence for the direction you hit.)  If you hold it down 
> so it repeats, on a slow system (such as qemu's arm emulation) or one that's 
> heavily loaded, you can easily have several of them queue up before VI gets 
> scheduled again.
> 
> A dozen times 3 characters is 36 characters.  If you look at editors/vi.c line 
> 216 you'll see that the buffer you're reading into (readbuffer) is 32 
> characters.  I.E. your buffer is not divisible by 3, so it'll read an even 10 
> cursor lefts, plus an escape left bracket pair which isn't part of a 
> recognized sequence, so is interpreted as separate characters.  The escape 
> drops you out of insert mode and into edit mode.
> 
> Next time it reads a buffer, it starts with the last character of a cursor 
> left sequence: capital D.  Capital D is "delete to end of line", which it 
> does.
> 
> So basically, busybox vi is corrupting your data when you cursor around in a 
> file on a loaded system.  Wheee...

Please try this patch, and let me know whether it helps.
--
vda
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 2.patch
Type: text/x-diff
Size: 3169 bytes
Desc: not available
Url : http://lists.busybox.net/pipermail/busybox/attachments/20081014/e1c3f539/attachment.bin 


More information about the busybox mailing list