zsh-workers
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: zsh-workers@sunsite.dk (Zsh hackers list)
Subject: Re: PATCH: Re: Minor expansion problem
Date: Tue, 25 Sep 2001 17:07:29 +0000	[thread overview]
Message-ID: <1010925170730.ZM11556@candle.brasslantern.com> (raw)
In-Reply-To: <1010925163945.ZM5789@candle.brasslantern.com>

On Sep 25,  4:39pm, Bart Schaefer wrote:
}
} } > Expanding $(...) doesn't put
} } > in backslashes, but expanding `...` does.  This appears to be happening
} } > because the ${(e)exp} at _expand line 83 returns one word for `...` but
} } > an array for $(...).
} 
} This seems to fix it

No, on second look, I mistyped my test case; it doesn't fix it after all.
Seems subst_parse_str() needs to turn Qtick into Tick as well as Qstring
into String.  The following goes on top of 15871.

Now I'm concerned enough about this to wait for some feedback before I
commit it.  All tests pass (including the new one below), but better safe
than sorry.

Index: Src/subst.c
===================================================================
diff -c -r1.6 subst.c
--- Src/subst.c	2001/09/05 15:22:33	1.6
+++ Src/subst.c	2001/09/25 17:00:08
@@ -133,7 +133,7 @@
 		str3 = (char *)getdata(node);
 		continue;
 	    }
-	} else if ((qt = c == Qtick) || c == Tick)
+	} else if ((qt = c == Qtick) || (c == Tick ? (mult_isarr = 1) : 0))
 	  comsub: {
 	    LinkList pl;
 	    char *s, *str2 = str;
@@ -724,9 +724,12 @@
             int qt = 0;
 
 	    for (; *s; s++)
-		if (!qt && *s == Qstring)
-		    *s = String;
-                else if (*s == Dnull)
+		if (!qt) {
+		    if (*s == Qstring)
+			*s = String;
+		    else if (*s == Qtick)
+			*s = Tick;
+                } else if (*s == Dnull)
                     qt = !qt;
 	}
 	return 0;
Index: Test/D04parameter.ztst
===================================================================
diff -c -r1.4 D04parameter.ztst
--- Test/D04parameter.ztst	2001/09/05 15:22:35	1.4
+++ Test/D04parameter.ztst	2001/09/25 16:52:53
@@ -212,10 +212,17 @@
 >split me
 >I'm yours
 
-  foo='$(print Howzat)'
-  print ${(e)foo}
+  foo='$(print Howzat usay)'
+  print -l ${(e)foo}
 0:${(e)...}
 >Howzat
+>usay
+
+  foo='`print Howzat usay`'
+  print -l ${(e)foo}
+0:Regress ${(e)...} with backticks (see zsh-workers/15871)
+>Howzat
+>usay
 
   foo='I'\''m nearly out of my mind with tedium'
   bar=foo

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com

Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net   


  reply	other threads:[~2001-09-25 17:07 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1010925153042.ZM5438@candle.brasslantern.com>
2001-09-25 16:08 ` Peter Stephenson
2001-09-25 16:39   ` PATCH: " Bart Schaefer
2001-09-25 17:07     ` Bart Schaefer [this message]
2001-09-25 17:16       ` Bart Schaefer
2001-09-25 17:23       ` Peter Stephenson
2001-09-25 17:36         ` 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=1010925170730.ZM11556@candle.brasslantern.com \
    --to=schaefer@brasslantern.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).