zsh-workers
 help / color / mirror / code / Atom feed
From: Peter Stephenson <pws@pwstephenson.fsnet.co.uk>
To: zsh-workers@sunsite.dk
Cc: 255788-forwarded@bugs.debian.org
Subject: Re: Bug#255788: $'' does not work after <<<
Date: Sun, 27 Jun 2004 01:07:47 +0100	[thread overview]
Message-ID: <20040627000749.5E7D0865D@pwstephenson.fsnet.co.uk> (raw)
In-Reply-To: "Bart Schaefer"'s message of "Sat, 26 Jun 2004 11:34:29 PDT." <Pine.LNX.4.60.0406261112340.19831@toltec.zanshin.com>

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 <pws@pwstephenson.fsnet.co.uk>
Work: pws@csr.com
Web: http://www.pwstephenson.fsnet.co.uk


  reply	other threads:[~2004-06-27  9:06 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20040623023305.GA15259@localhost>
2004-06-23 17:55 ` Clint Adams
2004-06-23 18:56   ` Bart Schaefer
2004-06-25  9:55   ` Peter Stephenson
2004-06-26 18:34     ` Bart Schaefer
2004-06-27  0:07       ` Peter Stephenson [this message]
2004-06-27 17:04         ` Bart Schaefer
2004-06-27 17:45           ` Peter Stephenson
2004-06-27 18:37             ` Bart Schaefer
2004-06-27 19:44               ` Peter Stephenson
2004-06-28 11:39                 ` PATCH: (2): " Peter Stephenson
2004-06-28 15:14                   ` Bart Schaefer
2004-06-28 15:29                     ` Peter Stephenson
2004-06-28 15:39                       ` Peter Stephenson
2004-06-28 17:26                       ` Bart Schaefer
2004-06-30 10:00                         ` Peter Stephenson
2004-06-30 15:58                           ` Bart Schaefer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20040627000749.5E7D0865D@pwstephenson.fsnet.co.uk \
    --to=pws@pwstephenson.fsnet.co.uk \
    --cc=255788-forwarded@bugs.debian.org \
    --cc=zsh-workers@sunsite.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).