zsh-workers
 help / color / mirror / code / Atom feed
From: Peter Stephenson <pws@csr.com>
To: zsh-workers@sunsite.dk,
	"Miciah D.B. Masters" <miciah@myrealbox.com>,
	255788-forwarded@bugs.debian.org
Subject: Re: Bug#255788: $'' does not work after <<<
Date: Fri, 25 Jun 2004 10:55:50 +0100	[thread overview]
Message-ID: <200406250955.i5P9tpMO029457@news01.csr.com> (raw)
In-Reply-To: "Clint Adams"'s message of "Wed, 23 Jun 2004 13:55:58 EDT." <20040623175558.GA19981@scowler.net>

Clint Adams wrote:
> Interesting that the x is disappearing.
> 
> > Current behaviour (tested with zsh -f):
> > 
> >    % cat <<< $'x\ny'
> >    \ny
> > 
> > Desired behaviour:
> > 
> >    % cat <<< $'x\ny'
> >    x
> >    y

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').  I haven't dared remove the dupstring() but I suspect
it must be redundant, somehow.

By the way I think this sort of thing ought to work, too:

cat <<$'a\tb'
Here document
a	t

so I've made it.  Again, it does in bash.  That's the first hunk.

Index: Src/exec.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/exec.c,v
retrieving revision 1.65
diff -u -r1.65 exec.c
--- Src/exec.c	22 Jun 2004 13:10:02 -0000	1.65
+++ Src/exec.c	25 Jun 2004 09:50:31 -0000
@@ -2714,9 +2714,10 @@
 
     for (s = str; *s; s++)
 	if (INULL(*s)) {
-	    *s = Nularg;
 	    qt = 1;
+	    break;
 	}
+    singsub(&str);
     untokenize(str);
     if (typ == REDIR_HEREDOCDASH) {
 	strip = 1;
Index: Src/parse.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/parse.c,v
retrieving revision 1.45
diff -u -r1.45 parse.c
--- Src/parse.c	22 Jun 2004 13:10:02 -0000	1.45
+++ Src/parse.c	25 Jun 2004 09:50:32 -0000
@@ -1755,7 +1755,7 @@
 	    type = tokstr[0] == Inang ? REDIR_INPIPE : REDIR_OUTPIPE;
 	break;
     case REDIR_HERESTR:
-        remnulargs(name = dupstring(name));
+        name = dupstring(name);
         break;
     }
     yylex();

-- 
Peter Stephenson <pws@csr.com>                  Software Engineer
CSR Ltd., Science Park, Milton Road,
Cambridge, CB4 0WH, UK                          Tel: +44 (0)1223 692070


**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.

This footnote also confirms that this email message has been swept by
MIMEsweeper for the presence of computer viruses.

www.mimesweeper.com
**********************************************************************


  parent reply	other threads:[~2004-06-26  9:19 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 [this message]
2004-06-26 18:34     ` Bart Schaefer
2004-06-27  0:07       ` Peter Stephenson
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=200406250955.i5P9tpMO029457@news01.csr.com \
    --to=pws@csr.com \
    --cc=255788-forwarded@bugs.debian.org \
    --cc=miciah@myrealbox.com \
    --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).