From: Jun T <takimoto-j@kba.biglobe.ne.jp>
To: zsh-workers@zsh.org
Subject: Re: [PATCH 1/2] Consolidated nofork substitution changes
Date: Fri, 22 Sep 2023 13:16:57 +0900 [thread overview]
Message-ID: <EFF69F26-15E6-4B5B-8D81-C679DC51AFF3@kba.biglobe.ne.jp> (raw)
In-Reply-To: <CAH+w=7avr_BmzxBSbjdhvtpngU3xaKV0yKBBge9nMOHjkGtgGg@mail.gmail.com>
The substitution ${ cmd args} has a problem with multi-byte
characters.
$ LC_ALL=en_US.UTF-8 zsh -f
% echo -n à | od -t x1
0000000 c3 a0
0000002
% echo -n ${ echo -n à} | od -t x1
0000000 c3 5c
000000
Maybe the following?
(I will not push this by myself even if it's a correct fix.)
diff --git a/Src/subst.c b/Src/subst.c
index dc2052ee0..65ae44c3f 100644
--- a/Src/subst.c
+++ b/Src/subst.c
@@ -2006,7 +2006,7 @@ paramsubst(LinkList l, LinkNode n, char **str, int qt, int pf_flags,
int onoerrs = noerrs;
noerrs = 2;
if ((cmdarg = ztuff(rplytmp)))
- setsparam("REPLY", cmdarg);
+ setsparam("REPLY", metafy(cmdarg, -1, META_HREALLOC));
noerrs = onoerrs;
}
}
next prev parent reply other threads:[~2023-09-22 4:17 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-16 22:20 Bart Schaefer
2023-09-22 4:16 ` Jun T [this message]
2023-09-22 4:32 ` Jun T
2023-09-23 0:25 ` Bart Schaefer
2023-09-23 1:41 ` Jun. T
2023-09-23 2:01 ` 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=EFF69F26-15E6-4B5B-8D81-C679DC51AFF3@kba.biglobe.ne.jp \
--to=takimoto-j@kba.biglobe.ne.jp \
--cc=zsh-workers@zsh.org \
/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).