Return to BSD News archive
Newsgroups: comp.os.386bsd.questions Path: sserve!newshost.anu.edu.au!munnari.oz.au!network.ucsd.edu!news.service.uci.edu!ucivax!news.claremont.edu!elroy.jpl.nasa.gov!sdd.hp.com!spool.mu.edu!bloom-beacon.mit.edu!xlink.net!subnet.sub.net!flatlin!bad From: bad@flatlin.ka.sub.org (Christoph Badura) Subject: Re: Anyone using the FEB 93 c news? with sh(1)? Organization: Guru Systems/Funware Department Date: Thu, 19 Aug 1993 10:24:01 GMT Message-ID: <CC04w1.DBp@flatlin.ka.sub.org> References: <almCBy2nL.E33@netcom.com> <CByzv7.Hw2@well.sf.ca.us> <CBz111.Ew8@kithrup.com> Lines: 68 In <CBz111.Ew8@kithrup.com> sef@kithrup.com (Sean Eric Fagan) writes: >diff -pr /usr/src/bin/sh/parser.c sh/parser.c >*** /usr/src/bin/sh/parser.c Mon Apr 15 17:23:22 1991 >--- sh/parser.c Sat Apr 17 14:58:56 1993 >*** 337,345 **** > n2->narg.backquote = NULL; > n2->narg.next = NULL; > n1->nfor.args = n2; > } >- if (lasttoken != TNL && lasttoken != TSEMI) >- synexpect(-1); > checkkwd = 2; > if ((t = readtoken()) == TDO) > t = TDONE; >--- 351,361 ---- > n2->narg.backquote = NULL; > n2->narg.next = NULL; > n1->nfor.args = n2; >+ /* A newline or semicolon is optional here. Anything >+ else gets pushed back so we can read it again. */ >+ if (lasttoken != TNL && lasttoken != TSEMI) >+ tokpushback++; > } > checkkwd = 2; > if ((t = readtoken()) == TDO) > t = TDONE; >*************** TRACE(("expecting DO got %s %s\n", tokna Change that part to look like this: *** parser.c,1 Tue Apr 16 02:23:22 1991 --- parser.c Thu Jan 21 00:47:55 1993 *************** *** 326,331 **** --- 326,333 ---- } *app = NULL; n1->nfor.args = ap; + if (lasttoken != TNL && lasttoken != TSEMI) + synexpect(-1); } else { #ifndef GDB_HACK static const char argvars[5] = {CTLVAR, VSNORMAL|VSQUOTE, *************** *** 337,345 **** n2->narg.backquote = NULL; n2->narg.next = NULL; n1->nfor.args = n2; } - if (lasttoken != TNL && lasttoken != TSEMI) - synexpect(-1); checkkwd = 2; if ((t = readtoken()) == TDO) t = TDONE; --- 339,346 ---- n2->narg.backquote = NULL; n2->narg.next = NULL; n1->nfor.args = n2; + tokpushback++; } checkkwd = 2; if ((t = readtoken()) == TDO) t = TDONE; -- Christoph Badura --- bad@flatlin.ka.sub.org --- +49 721 606137 Personally, I don't care whether someone is cool enough to quote Doug Gwyn--I only care whether Doug Gwyn is cool enough to quote. -- Larry Wall