From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from euclid.skiles.gatech.edu (list@euclid.skiles.gatech.edu [130.207.146.50]) by coral.primenet.com.au (8.7.5/8.7.3) with ESMTP id XAA00430 for ; Fri, 2 Aug 1996 23:44:45 +1000 (EST) Received: (from list@localhost) by euclid.skiles.gatech.edu (8.7.3/8.7.3) id JAA21849; Fri, 2 Aug 1996 09:30:51 -0400 (EDT) Resent-Date: Fri, 2 Aug 1996 09:30:51 -0400 (EDT) From: Zoltan Hidvegi Message-Id: <199608021329.PAA04346@bolyai.cs.elte.hu> Subject: Re: More Configure problems To: borsenkow.msk@sni.de Date: Fri, 2 Aug 1996 15:29:57 +0200 (MET DST) Cc: pws@ifh.de, zsh-workers@math.gatech.edu In-Reply-To: from Andrej Borsenkow at "Aug 2, 96 02:03:06 pm" Organization: Dept. of Comp. Sci., Eotvos University, Budapest, Hungary Phone: (36 1)2669833 ext: 2667, home phone: (36 1) 2752368 X-Mailer: ELM [version 2.4ME+ PL16 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Resent-Message-ID: <"ngjxj2.0.JL5.ACW0o"@euclid> Resent-From: zsh-workers@math.gatech.edu X-Mailing-List: archive/latest/1890 X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu > But small problem with command substitution anyway. The following: > > % : ` > bquote> cat > foo << eof > bquote> a > bquote> eof > bquote> ` > > <-- !!! > > runs perfectly on my /bin/sh (and should according to POSIX :)) but not > under zsh. (Including last three patches to heredoc an $(< ...) fix). It > wants something after the last backtick. The same problem with $() form. > If the heredoc delimiter is quoted, it is O.K. > > % : ` > bquote> cat > foo << \eof > bquote> a > bquote> eof > bquote> ` > % > > Again in `` or $() form. Yes, it is a problem, and I think it may cause problems in other circumstances as well. The patch below fixes that. This bug is really fixed by the hist.c patch below but it also contains a lex.c fix because I first thought that the problem is there. Zoltan *** Src/hist.c 1996/07/21 00:05:50 2.22 --- Src/hist.c 1996/08/02 13:07:29 *************** *** 567,573 **** void strinbeg(void) { ! strin = 1; hbegin(); lexinit(); } --- 567,573 ---- void strinbeg(void) { ! strin++; hbegin(); lexinit(); } *************** *** 579,585 **** strinend(void) { hend(); ! strin = 0; isfirstch = 1; histdone = 0; } --- 579,586 ---- strinend(void) { hend(); ! DPUTS(!strin, "BUG: strinend() called without strinbeg()"); ! strin--; isfirstch = 1; histdone = 0; } *** Src/lex.c 1996/08/01 17:56:17 2.41 --- Src/lex.c 1996/08/02 13:16:25 *************** *** 65,70 **** --- 65,71 ---- int chwordlen; int chwordpos; int hwgetword; + int lexstop; struct heredocs *hdocs; unsigned char *cstack; *************** *** 117,122 **** --- 118,124 ---- ls->chwordlen = chwordlen; ls->chwordpos = chwordpos; ls->hwgetword = hwgetword; + ls->lexstop = lexstop; ls->hdocs = hdocs; cmdsp = 0; inredir = 0; *************** *** 162,171 **** chwordlen = lstack->chwordlen; chwordpos = lstack->chwordpos; hwgetword = lstack->hwgetword; hdocs = lstack->hdocs; clearalstack(); hlinesz = lstack->hlinesz; ! lexstop = errflag = 0; ln = lstack->next; free(lstack); --- 164,174 ---- chwordlen = lstack->chwordlen; chwordpos = lstack->chwordpos; hwgetword = lstack->hwgetword; + lexstop = lstack->lexstop; hdocs = lstack->hdocs; clearalstack(); hlinesz = lstack->hlinesz; ! errflag = 0; ln = lstack->next; free(lstack); *************** *** 370,375 **** --- 373,380 ---- beginning: tokstr = NULL; while (iblank(c = hgetc()) && !lexstop); + if (lexstop) + return (errflag) ? LEXERR : ENDINPUT; isfirstln = 0; wordbeg = inbufct - (qbang && c == bangchar); hwbegin(-1); /* word includes the last character read */ *************** *** 390,400 **** return DOUTPAR; } else if (idigit(c)) { /* handle 1< foo */ d = hgetc(); - hungetc(d); - lexstop = 0; if (d == '>' || d == '<') { peekfd = c - '0'; ! c = hgetc(); } } --- 395,406 ---- return DOUTPAR; } else if (idigit(c)) { /* handle 1< foo */ d = hgetc(); if (d == '>' || d == '<') { peekfd = c - '0'; ! c = d; ! } else { ! hungetc(d); ! lexstop = 0; } } *************** *** 423,430 **** } return peek; } - if (lexstop) - return (errflag) ? LEXERR : ENDINPUT; switch (lexact1[STOUC(c)]) { case LX1_BKSLASH: d = hgetc(); --- 429,434 ----