[Toybox] [PATCH] vi.c: added v command, updated help text, Fixed memory leak in 'g' command

Oliver Webb aquahobbyist at proton.me
Mon Oct 16 20:29:25 PDT 2023


------- Original Message -------
On Monday, October 16th, 2023 at 04:21, Rob Landley <rob at landley.net> wrote:


> On 10/14/23 17:15, Oliver Webb via Toybox wrote:
> 
> > I have added the 'v' command (Which is essentially the opposite of the g[lobal] command).
> > Fixed a memory leak in the g[lobal] command (Freeing data while aborting)
> > Along with some code formatting (Replacing *(cmd+1) with cmd[1])
> 
> 
> I removed the hunk adding a SUBSTRING() macro which you never called and which
> doesn't seem that much of an improvement over the call to xmprintf() anyway...
> 
> By the way, I've mostly been cleaning up the:
> 
> .git/rebase-apply/patch:56: trailing whitespace. }
> warning: 1 line adds whitespace errors.
> 
> in all your patches, but I didn't bother this time.

My bad, Removed the trailing whitespace in this patch

> > I have been trying to get a implementation of the s[ubsitute] command to work in vi.c.
> > The best I have been able to implement barely works. I know sed.c has one that does what
> > I am trying to do but I haven't been able to implement the algorithm that sed.c is using.
> 
> 
> I was hoping to get stuff to share code, but I can worry about that in the
> eventual cleanup pass.

If you are planning on code-sharing the regex line substitution stuff.
Then this will probably be my last patch to vi.c for a while 
(Unless there is something wrong with it that can be fixed reasonably).

I have removed some of the overhead to minimize throughput, Replacing "run_vi_cmd("j")" 
with "cur_down(1, 1, 0)" The page clearing function calls with setting vi_mov_flag, etc. 

> Rob

- Oliver Webb <aquahobbyist at proton.me>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Replaced-some-calles-to-run_vi_cmd-to-more-direct-ca.patch
Type: text/x-patch
Size: 2834 bytes
Desc: not available
URL: <http://lists.landley.net/pipermail/toybox-landley.net/attachments/20231017/f3d550c6/attachment.bin>


More information about the Toybox mailing list