minor vi bug (and possible fix)

John Greco greco at drexel.edu
Wed Mar 24 23:41:14 UTC 2010


I've noticed that busybox's vi doesn't handle <count>$ like other vi
implementations.  From Vim's help section on $:

$  or <End>      To the end of the line.  When a count is given also go
                 [count - 1] lines downward |inclusive|.

This behaviour is also mentioned in:
<http://www.opengroup.org/onlinepubs/9699919799/utilities/vi.html>

Busybox's vi does not act on any count given for $.

A very simple one line fix could be:

        case '$':                       // $- goto end of line
        case KEYCODE_END:               // Cursor Key End
                if (cmdcnt-- > 1) {
+                       dot_next();
                        do_cmd(c);
                }                               // repeat cnt
                dot = end_line(dot);


I hope I'm sending this to the right place, thanks for your time.

 -John L. Greco


More information about the busybox mailing list