[Toybox] [PATCH] Addition of the 'g' command to vi.c

Oliver Webb aquahobbyist at proton.me
Mon Oct 9 20:43:15 PDT 2023


Heya, I added the 'g' ex command to vi
The only problem with it that I see is (also a problem in cslpit with /regex/ rules) 
that it doesn't read escaped regexp's because 
sscanf(); doesn't work like that and I haven't found a simple solution to reading 
escaped strings up until a delimiter (except when that delimiter is escaped)

The only reason this command took so long to implement is because I had some errors
that turned out to be caused by uninitialized memory. 

I would write some test cases to go with this command, but I already have a pending patch
for other test cases that I have added and I didn't want to have a conflict
between the 2 patches 

Also, In the error message handling, I replaced "sleep(1);" with "(void)getchar();".

- Oliver Webb <aquahobbyist at proton.me>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-vi.c-Added-ex-g-command-Replaced-sleep-1-with-getcha.patch
Type: text/x-patch
Size: 1798 bytes
Desc: not available
URL: <http://lists.landley.net/pipermail/toybox-landley.net/attachments/20231010/78f8ea23/attachment-0001.bin>


More information about the Toybox mailing list