General TC > General TC Talk
busybox vi ":s" command
andyj:
I can give it a try. Do you have both 32 and 64 bit versions, or just one of them?
curaga:
Denys, the BB maintainer, is often busy, and you need to ping your patch a couple times.
jazzbiker:
Hi, curaga!
Clear, let's test this patch and if TinyCore comunity members and maintainers will account it useful I will accomodate it for the BB-current.
Hi, andyj!
Sorry for delay, I took some attempts to lower the memory consumption, but without success. The problem is that when we are using regexp find/replace the output string may be quite big even for very short command. And current vi memory model is : whole text placed in the RAM as a single chunk. So inserting X byte-long string inside the text of Y bytes size may require for at least 3*X+Y bytes for realloc(), don't forget about undo buffer. So I've made the dummy limit of 1M (MAX_SUBSTITUTED_LEN in the source) for substituted string length. Of course the smarter approach is to try allocate 3*X+Y, if failed then stop the operation, and in the case of success free this buf immediately and allocate the X-size buffer. If You will test the patch and approve it is working, I can continue with it. Another thing TODO is storing the last :s command data for further use as default, but this will need touching globals. Not a difficult issue, but not ready yet.
If You will build busybox-1.29.3, don't apply the vi-aimed patch from the repo src directory, apply only this one attached, it includes all: ranges, backward search and regexps.
I will wait for the reply.
Regards!
jazzbiker:
Hi, Core people!
If You sometimes look into busybox git log, You can notice that Ron Yorston has made o lot of patches for vi. Now he is helping me to make my patch more submittable. He proposed a lot of improvements and among them he proposes to use basic REGEXes instead of extended ones both for ':s' and '/' commands. Such change is orthogonal to whether my patch will be committed or not or another changes. But it may be harmful for those, who uses REGEXes in busybox vi.
As it appeared, the only distributions which have busybox vi built with VI_REGEX_SEARCH option enbled are TinyCore Linux and Fedora. But Fedora have nano in the minimal distribution.
I guess it will be correct before making such changes to poll TinyCore developers about their attitude.
So the question is:
Will the use of basic REGEXes for busybox vi ':s' and '/' commands harm You?
Of course I'm most interested in Curaga, Juanito, Jason W, bmarkus and Paul_123 opinions, but everybody please answer, what kind of REGEXes do You prefer.
Best regards!
Edit:
vi is the only editor described in POSIX, and POSIX proposes basic REGEXes for vi. As far as I can notice, Ron's patches aim making busybox vi as much POSIX-compatibe as possible.
n0m0n:
Hi, just wanted to say that I'd love to see better :s support in busybox vi. vim is lovly but often a bit overkill to install for quick edits/fixes.
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version