On Fri, Jan 27, 2017 at 7:56 AM, Patrick Pief <[email protected]> wrote: > There were several times where I thought that having "exec -a" in busybox > would > be neat, and while "exec -a" is not POSIX it is still supported in a lot of > shells (see http://unix.stackexchange.com/q/250681/117599 ). > > So, here is now my first attempt at adding support for it, I basically made a > copy of shellexec() called shellexeca() with support for a different target > argv0 different than what is executed. I edited execcmd() to call the new > function if the "-a" option gets used. I know that you might not like the > fact that I duplicated that much code but keep in mind that this is my first > attempt and I would first like to know: > > 1. Your general feelings on this, e.g. if you are against this feature in > general and are never going to accept a PATCH adding support for it then > please let me know. > > 2. Whether to hide this using the preprocessor flag and make it an official > setting. > > 3. Whether to make shellexeca() to be the new shellexec() and change all > invocations of latter (I think this would make hiding it using the > preprocessor harder).
I would personally prefer hiding your change in a preprocessor flag. That way people who don't want that feature won't need to build it. I'm not sure if this is going to be a separate config option or just a BASH_ preprocessor symbol, though. (Better ask Denys Vlasenko, the maintainer.) And, don't duplicate another function if what you did is only extending a functionality of that function. BusyBox is coded with size in mind. Duplicating a function will mean wasting space. Besides, if you code within shellexec() we can see a better diff on what you have extended. Kang-Che Sung _______________________________________________ busybox mailing list [email protected] http://lists.busybox.net/mailman/listinfo/busybox
