[email protected] wrote in <1296430566.11936823.1760360488369.javamail.r...@zimbra33-e6.priv.proxad\ .net>: |reporting unexpected behaviour of bb, moreprecisely it's arithmetic \ |ternary operator.
This thing is totally broken in at least the more complicated cases --- despite the decades of people trying to do it better with Dijkstra's two stack algorithm "as-is", as far as i remember from code comments. I have written a fully functional variant using Dijkstra, but (add/remove: 7/4 grow/shrink: 2/1 up/down: 4535/-2527) Total: 2008 bytes for one, and then hm maybe politics. Locally i use my thing ever since i wrote it, and it is also part of the MUA i maintain, and will be released with it somewhen in the forthcoming months. (The MUA code has three fixes that are not yet reintegrated into the busybox patch, UBSAN fixes as via Harald van Dijk, plus a meaning-reversal regarding "all-consumed" vs "remains exist", plus an error condition fix that cannot happen when used in busybox. Just a few lines, all in all.) In short. I would not know how to implement shell arithmetics that support infinitely recursive ternary conditions via Dijkstra other than how i have done it, and it is a pain in the ass, honestly speaking. But a recursive descendent parser as bash uses it may not really be much smaller, and it could anyhow be it is slower because of all the (micro-)state(s) everywhere. I posted the original patch here by the end of 2022 i think. --steffen | |Der Kragenbaer, The moon bear, |der holt sich munter he cheerfully and one by one |einen nach dem anderen runter wa.ks himself off |(By Robert Gernhardt) _______________________________________________ busybox mailing list [email protected] https://lists.busybox.net/mailman/listinfo/busybox
