case `echo ' '` in
esac
out of string space
This is caused by an endless loop that is fixed with the patch
below. I start to wonder if anybody runs serious scripts with
the Minix shell, because this is already the second bug I found
in the shell trying to run a large script!
Michael "torturing /bin/sh"
----------------------------------------------------------------------
*** sh4.c.orig Sun May 23 15:03:44 1999
--- sh4.c Sun May 23 16:57:21 1999
***************
*** 192,198 ****
for (;;) {
c = subgetc('"', foundequals);
if (c == 0 ||
! f & (DOBLANK && any(c, ifs->value)) ||
(!INSUB() && any(c, "\"'"))) {
scanequals = 0;
unget(c);
--- 192,198 ----
for (;;) {
c = subgetc('"', foundequals);
if (c == 0 ||
! (f & DOBLANK && any(c, ifs->value)) ||
(!INSUB() && any(c, "\"'"))) {
scanequals = 0;
unget(c);
: case `echo ' '` in
: esac
: out of string space
: This is caused by an endless loop that is fixed with the patch
: below. I start to wonder if anybody runs serious scripts with
: the Minix shell, because this is already the second bug I found
: in the shell trying to run a large script!
I gave up on the standard Minix shell a while back; the problem was
that its behaviour was pretty much undocumented (I couldn't tell bugs
from features), and the code too difficult to read. I wrote a man page
for sh after a lot of experiments, but never tried to fix any of the
problems I found. The newer ash shell seems a better bet if you want
reliability, though I haven't hammered it especially hard.
I agree on ash being better, but it should be possibly to debug
/bin/sh enough to run common scripts. I know that there are quite some
differences when it comes to quoting, but the bugs I found so far are
serious internal errors. I will continue fixing them, because after
all, I am running my Minix system just for hack value. :)
Michael