2acb02f29b
when executing a script, we did advance argp0 unconditionally to replace argv[0] with the script name. this fails when argv[] is empty, then we'd advance argp0 past the nil terminator. the alternative would be to *not* advance if *argp0 == nil, but that would require another validaddr() check for a case that is unlikely to have been anticipated in most programs being invoked as libc's ARGBEGIN macro assumes argv[0] being non-nil as it also unconditionally advances the argv pointer. to keep us sane, we now reject an empty argv[]. on entry, we verify that argv[] is valid for at least two elements: - the program name argv[0], has to be non-nil - the first potential nil terminator in argv[1] when argv[0] == nil, we throw Ebadarg "bad arg in system call" |
||
---|---|---|
.. | ||
doc | ||
games/lib | ||
include | ||
lib | ||
man | ||
src |