I've tested these patches and it seems to be working: OSv is able to boot even when environment variables contain spaces. @Nadav, could you please review/accept? There are supposed to be 6 commits here, but the first one [01/06] is somehow missing on this email thread and can be found here: https://groups.google.com/forum/#!topic/osv-dev/m84C7DXKdYY (not sure why). Justin depends on this functionality to be accepted before he can introduce support for environment variables with spaces in the `runscript` program.
Thanks! Regards, Miha Dne Ĩetrtek, 24. avgust 2017 18.57.09 UTC+2 je oseba Justin Cinkelj napisala: > > This patches allow to set environment variables with spaces via run.py, > as is > run.py -e '--env=AAA=aaa\ bbb /hello_env.so arg1 arg2' > The spaces has to be escaped with \. > > stresep implementation is from NetBSD. > > The hello-world example of using stresep (NetSBD man page, > http://netbsd.gw.com/cgi-bin/man-cgi?stresep+3+NetBSD-current > get longer once 'stop parsing after first not-loader-option token' > is implemented. So this is in a separate function loader_parse_cmdline, > which is then also tested independendently from osv::parse_commandline. > > Justin Cinkelj (6): > libc: add stresep > libc: fix of-by-one error in stresep > command line: add loader_parse_cmdline with tests > command line: use loader_parse_cmdline > command line: add tests for empty commandline string parsing > command line: check for empty cmdline case after parsing cmdline > > Makefile | 1 + > arch/x64/boot.S | 4 +- > core/commands.cc | 144 ++++++++++++++++++++++---- > include/api/string.h | 1 + > include/osv/commands.hh | 6 +- > libc/string/stresep.c | 82 +++++++++++++++ > loader.cc | 55 ++++------ > tests/tst-commands.cc | 268 > ++++++++++++++++++++++++++++++++++++++++++++++++ > 8 files changed, 502 insertions(+), 59 deletions(-) > create mode 100644 libc/string/stresep.c > > -- > 2.9.4 > > -- You received this message because you are subscribed to the Google Groups "OSv Development" group. To unsubscribe from this group and stop receiving emails from it, send an email to osv-dev+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.