From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13143 invoked from network); 27 Jun 2004 09:06:16 -0000 Received: from odin.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.85) by ns1.primenet.com.au with SMTP; 27 Jun 2004 09:06:16 -0000 Received: (qmail 12307 invoked from network); 27 Jun 2004 01:09:17 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 27 Jun 2004 01:09:17 -0000 Received: (qmail 7559 invoked by alias); 27 Jun 2004 00:00:16 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 20107 Received: (qmail 7533 invoked from network); 27 Jun 2004 00:00:15 -0000 Received: from odin.dotsrc.org (HELO a.mx.sunsite.dk) (qmailr@130.225.247.85) by sunsite.dk with SMTP; 27 Jun 2004 00:00:15 -0000 Received: (qmail 11991 invoked from network); 27 Jun 2004 01:09:11 -0000 Received: from cmailm4.svr.pol.co.uk (195.92.193.211) by a.mx.sunsite.dk with SMTP; 27 Jun 2004 01:09:10 -0000 Received: from modem-211.bursa-trigger.dialup.pol.co.uk ([62.136.244.211] helo=pwstephenson.fsnet.co.uk) by cmailm4.svr.pol.co.uk with esmtp (Exim 4.14) id 1BeN5g-0001DD-C8; Sun, 27 Jun 2004 01:00:12 +0100 Received: by pwstephenson.fsnet.co.uk (Postfix, from userid 501) id 5E7D0865D; Sat, 26 Jun 2004 20:07:49 -0400 (EDT) Received: from pwstephenson.fsnet.co.uk (localhost [127.0.0.1]) by pwstephenson.fsnet.co.uk (Postfix) with ESMTP id 33A88865B; Sun, 27 Jun 2004 01:07:49 +0100 (BST) To: zsh-workers@sunsite.dk Cc: 255788-forwarded@bugs.debian.org Subject: Re: Bug#255788: $'' does not work after <<< In-reply-to: "Bart Schaefer"'s message of "Sat, 26 Jun 2004 11:34:29 PDT." Date: Sun, 27 Jun 2004 01:07:47 +0100 From: Peter Stephenson Message-Id: <20040627000749.5E7D0865D@pwstephenson.fsnet.co.uk> X-Spam-Checker-Version: SpamAssassin 2.63 on a.mx.sunsite.dk X-Spam-Level: * X-Spam-Status: No, hits=1.5 required=6.0 tests=BAYES_50,RCVD_IN_SORBS autolearn=no version=2.63 X-Spam-Hits: 1.5 Bart Schaefer wrote: > On Fri, 25 Jun 2004, Peter Stephenson wrote: > > I don't know the history of this, but it looks like someone got their > > wires crossed since the remnulargs() in the parsing code is obviously > > incompatible with the singsub() in the exec code (er, for certain values > > of `obviously'). > > Um, except that the singsub() wasn't present in the exec code until you > added it just now? So the remnulargs() was needed to, well, remove the > Nulargs formerly inserted by the loop that you also modified. No, the singsub() *was* already in that function (for here strings). The bit where I added singsub() was in here documents, not here strings. > Before this patch: > > schaefer<501> bar=baz > schaefer<502> cat <<$bar > heredoc> foo > heredoc> baz > heredoc> $bar > foo > baz > schaefer<503> > > After this patch: > > schaefer<502> cat <<$bar > heredoc> foo > heredoc> baz > foo > schaefer<503> I guess the print-like behaviour of $'...' is the only thing we do want, right? '...' has no special effect, and "..." does $-style and `-style expansions which we don't want. The two approaches seem to be either an option to untokenize() to remove the bits we don't want expanded, or dig deeper into singsub() to bring out the bit we want. (By the way, I think this compromise sucks, but it does look like we're stuck with it.) Hmm, we also need to decide whether this applies to here strings. My view would be that they get the full expansion treatment, since they are essentially a command argument, not a glorified end marker. But I'm sure you'll let me know if I'm wrong. (I'll make this clear in the documentation either way.) > > I haven't dared remove the dupstring() but I suspect > > it must be redundant, somehow. > > The reason for the dupstring() is that remnulargs() modifies its argument > in place. If you take out remnulargs() you can take out the dupstring(). That's what I assumed. But I didn't really understand how the memory allocation for the bits of the here-document structures worked. -- Peter Stephenson Work: pws@csr.com Web: http://www.pwstephenson.fsnet.co.uk