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 AAA00394 for ; Fri, 2 Aug 1996 00:00:31 +1000 (EST) Received: (from list@localhost) by euclid.skiles.gatech.edu (8.7.3/8.7.3) id JAA08049; Thu, 1 Aug 1996 09:50:56 -0400 (EDT) Resent-Date: Thu, 1 Aug 1996 09:50:56 -0400 (EDT) Message-Id: <199608011349.PAA09906@hydra.ifh.de> To: zsh-workers@math.gatech.edu (Zsh hackers list) Subject: Here docs In-reply-to: "borsenkow.msk@sni.de"'s message of "Thu, 01 Aug 1996 13:10:42 MET." Date: Thu, 01 Aug 1996 15:49:39 +0200 From: Peter Stephenson Resent-Message-ID: <"mslMW3.0.hz1._OB0o"@euclid> Resent-From: zsh-workers@math.gatech.edu X-Mailing-List: archive/latest/1873 X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu I expect Zoltan's already fixed this, but anyway... borsenkow.msk@sni.de wrote: > On Thu, 1 Aug 1996, Peter Stephenson wrote: > > > Anyone know the proper backslash rules for here documents? > > Here is relevant part form XPG4 Shell: > > 1. Section 2.7.4 (Here-document) > > ... > In this case, the backslash in the input will behave as the > backslash inside double-quotes (see Section 2.2.3) However, the > double-quote character (") will not be treated specially within a > here-document, except when the double-quote appears within $(), ``, or > ${}. That's clear enough for here documents... the question is what should happen at other times when zsh is parsing something in the same way. This is usually when tokenising a string that hadn't already been through the lexer, but is going to have some substitution arrangement performed on it (this does not include many obvious cases like $(...)). If the answer is that \" should be left in this case too, the fix is easy. I believe this fix is right in all those cases for the following reason: the code in dquote_parse() is specifically set up not to treat unbackslashed " specially in these circumstances (test at line 1095 of lex.c), so should not treat backslashed " specially either. This should make Configure happier, any chance that it might work now? There's a very minor difference left: % cat < ${not_set:-\}} > EOS ksh gives \} and zsh gives } as output. I like zsh's better. *** Src/lex.c.bsqt Wed Jul 24 16:34:31 1996 --- Src/lex.c Thu Aug 1 15:29:18 1996 *************** *** 1001,1007 **** c = hgetc(); if (c != '\n') add(c == '$' || c == '\\' || (c == '}' && !intick && bct) || ! c == '\"' || c == '`' ? Bnull : '\\'); else if (sub || unset(CSHJUNKIEQUOTES) || endchar != '"') continue; break; --- 1001,1007 ---- c = hgetc(); if (c != '\n') add(c == '$' || c == '\\' || (c == '}' && !intick && bct) || ! (endchar && c == '\"') || c == '`' ? Bnull : '\\'); else if (sub || unset(CSHJUNKIEQUOTES) || endchar != '"') continue; break; -- Peter Stephenson Tel: +49 33762 77366 WWW: http://www.ifh.de/~pws/ Fax: +49 33762 77330 Deutches Electronen-Synchrotron --- Institut fuer Hochenergiephysik Zeuthen DESY-IfH, 15735 Zeuthen, Germany.