• reference “shellshock” of GNU bash for exporting functions
• mention we don’t export arrays (just their "0" members) as
ksh93 and GNU bash don’t do it either, the latter documen‐
ting it even
also, their sysctl(8) sucks:
13:31⎜«gecko» naja, sysctl bricht die ausgabe bei nicht vorhandenen parametern ab
13:32⎜«gecko» der listet aktuell nur bis hw.memsize auf
Command line length limit of OS/2 is 32KiB. If the total length of
all arguments is larger than this limit, it's needed to use a
response file.
Previously, the total length calculation was simply to add length of
all arguments. However, this result was not match with real length of
arguments, which are passed to child processes with OS/2 APIs.
Because conversion methods of arguments from libc to OS/2 APIs are
different depending on libc.
For example, kLIBC inserts its signature to an argument list. In
addition, it passes arguments with a leading space like:
arg0
kLIBC signature
arg1
arg2
...
Whereas, EMX just distinguishes arg0 and others like:
arg0
arg1 arg2 arg3 ...
After all, simple sum of a length of arguments are not correct.
The better way is to try to execute a child process, and to retry with
a response file if it fails due to arguments-too-long.
This has been found while doing 'bootstrap', especially 'autoreconf'
in coreutils git repo. It stops with:
autom4te: /usr/local/bin/m4: Invalid argument
From: KO Myung-Hun <komh@chollian.net>
Normal OS/2 programs expect that standard IOs, especially stdin,
are opened in text mode at the startup. By the way, on OS/2 kLIBC
child processes inherit a translation mode of a parent process.
As a result, if stdin is set to binary mode in a parent process,
stdin of child processes is opened in binary mode as well at the
startup. In this case, some programs such as sed suffer from CR.
This is the regression fix of commit 20dbf6.
From: KO Myung-Hun <komh@chollian.net>
‣ also makes the error message nicer:
tg@blau:/usr/obj/bin/mksh $ mksh -n -c '${0$(($(o[))&$(($(p[))&)'
internal error: can't allocate 8388628 data bytes
tg@blau:/usr/obj/bin/mksh $ mksh -n -c '${0$(($(o[))&$(($(p[))&)^J'
mksh: no closing quote
1|tg@blau:/usr/obj/bin/mksh $ ./mksh -n -c '${0$(($(o[))&$(($(p[))&)'
./mksh: syntax error: unmatched '('
1|tg@blau:/usr/obj/bin/mksh $ ./mksh -n -c '${0$(($(o[))&$(($(p[))&)^J'
./mksh: syntax error: unmatched '('
‣ alternative fix would be to keep the block and do…
- } else {
+ } else if (source->type != SEOF) {
… but that would keep “no closing quote” for the case with newline,
and since this seems to not break… nuking unused code is always good ☻
really, getdrvwd should be passed an Xstring (probably with Xinit0 in
the callers), especially as one caller already didn’t update ldestlen
properly… (but not tonight as I’ve really got no head for that left)
instead of parsing extern char **environ; read it from a filesystem
(typical for Plan 9, though this one is __jehanne__ per ifdef)
tested on MirBSD and found to be working