old vi bug still alive ...

walter harms wharms at bfs.de
Fri Nov 21 12:32:30 UTC 2008


you are right,
but i think the patch must go into 13.1
1. it does not crash
2. most users will not stress test vi and it is ok if you type a few lines

re,
 wh

ps: i am buried in work but i will try my best to get thinks done on the WE


Denys Vlasenko schrieb:
> On Thu, Nov 20, 2008 at 5:39 PM, walter harms <wharms at bfs.de> wrote:
>> hi Denys,
>>
>> the patch seems to work, i was unable to replicate the bug.
>> i had the feeling that vi is solower now, but i may be wrong
>> since i crashed early most times.
> 
> Yes. For example, again, when you press <Enter>
> autoindent will do:
> 
>                         for (; isblank(*q); q++) {
>                                 uintptr_t bias = stupid_insert(p, *q);
>  // insert the char
>                                 p += bias + 1;
>                                 q += bias;
>                         }
> 
> Thus we do stupid_insert for every whitespace char
> in the preceding line (imagine ~50 space chars),
> and stupid_insert -> text_hole_make will do:
> 
>         memmove(p + size, p, end - size - p);
>         memset(p, ' ', size);   // clear new hole
> 
> 50 memmove's, each moving around entire tail of the file!
> You might want to make a patch which does:
> 
> 1. measure how many blank chars are there.
> 2. tmp = xstrndup(q, num_blank_ch);
> 3. string_insert(p, tmp);
> 4. free(tmp);

> instead of that for() loop.
> --
> vda
> 
> 
> 



More information about the busybox mailing list