From: Alan Cox Date: Sat, 16 May 2015 19:08:03 +0000 (+0100) Subject: sh: sdcc miscompiles (foo = bar)->x = 1 so avoid X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=31fca4508cc3414188f91856fb9a703d223db4bc;p=FUZIX.git sh: sdcc miscompiles (foo = bar)->x = 1 so avoid It's a strange syntax anyway ! With this applied internal commands sort of work but executing external commands fails and "set" likewise shows there is some kind of variable space corruption problem to pin down first --- diff --git a/Applications/V7/cmd/sh/io.c b/Applications/V7/cmd/sh/io.c index 0f995d06..707bf788 100644 --- a/Applications/V7/cmd/sh/io.c +++ b/Applications/V7/cmd/sh/io.c @@ -30,7 +30,8 @@ int estabf(register const char *s) { register FILE f; - (f = standin)->fdes = -1; + f = standin; + f->fdes = -1; f->fend = length(s) + (f->fnxt = (char *)s);/*FIXME review */ f->flin = 1; return (f->feof = (s == 0)); @@ -40,7 +41,8 @@ void push(FILE af) { register FILE f; - (f = af)->fstak = standin; + f = af; + f->fstak = standin; f->feof = 0; f->feval = 0; standin = f; @@ -50,7 +52,8 @@ int pop(void) { register FILE f; - if ((f = standin)->fstak) { + f = standin; + if (f->fstak) { if (f->fdes >= 0) close(f->fdes); standin = f->fstak;