[Toybox] vi 'b' command broken

Rob Landley rob at landley.net
Wed Oct 4 17:09:09 PDT 2023


On 10/4/23 19:03, Rob Landley wrote:
> And I'm backing slowly away from this Thing That Needs Focus To Clean Up. Gotta
> close the open cans of worms first, thanks...

The if/else staircase on TT.vi_mode in vi_main() seems like an obvious potential
place to call ex/normal/insert functions to provide different behavior, but
breaking that out depends on local variables in the function the first of which
is char stdout_buf[8192] which immediately raises the question "why?" and the
second question "if we do need it, why isn't this using toybuf" and the existing
users of toybuf include text_strstr() calling text_getline()toybuf,
ARRAY_LEN(toybuf) which could just be sizeof(toybuf) because dividing by
sizeof(char) doesn't help here but ALSO raises the question of how you know this
line doesn't go beyond 4k, and then write_file() does sprintf(toybuf, "%s.swp",
filename); which gets filename from TT.filename which came from *toys.optargs
which VERY DEFINITELY can go beyond 4k...

And I am again BACKING AWAY SLOWLY.

> Rob

Still Rob


More information about the Toybox mailing list