From: Bart Schaefer <schaefer@brasslantern.com>
To: zsh-workers@sunsite.dk (Zsh hackers list)
Subject: PATCH: Re: Minor expansion problem
Date: Tue, 25 Sep 2001 16:39:45 +0000 [thread overview]
Message-ID: <1010925163945.ZM5789@candle.brasslantern.com> (raw)
In-Reply-To: <8328.1001434108@csr.com>
On Sep 25, 5:08pm, Peter Stephenson wrote:
}
} 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 $(...).
}
} Yes, it's completely reproducible just with ${(e)exp}.
This seems to fix it (and a typo in a comment). I'm a bit dubious of
changing mult_isarr possibly in the middle of a word, but that's what
happens in the $(...) case at line 111, so ...
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 16:33:20
@@ -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;
@@ -1492,7 +1492,7 @@
/* This once was executed only `if (qt) ...'. But with that
* patterns in a expansion resulting from a ${(e)...} aren't
* tokenized even though this function thinks they are (it thinks
- * they are because subst_parse_string() turns Qstring tokens
+ * they are because subst_parse_str() turns Qstring tokens
* into String tokens and for unquoted parameter expansions the
* lexer normally does tokenize patterns inside parameter
* expansions). */
--
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
next prev parent reply other threads:[~2001-09-25 16:40 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 ` Bart Schaefer [this message]
2001-09-25 17:07 ` PATCH: " Bart Schaefer
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=1010925163945.ZM5789@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).