mirror of
https://github.com/zsh-users/zsh
synced 2024-07-21 10:14:19 +00:00
26705: multibyte characters with Meta in ${(%)foo} etc.
This commit is contained in:
parent
6f3f3c6a01
commit
e391f09457
|
@ -1,3 +1,9 @@
|
|||
2009-03-10 Peter Stephenson <pws@csr.com>
|
||||
|
||||
* 26705: Src/subst.c, Test/D07multibyte.ztst: still problems
|
||||
with multibyte characters with Meta in prompt expansion within
|
||||
parameter expansion.
|
||||
|
||||
2009-03-09 Peter Stephenson <pws@csr.com>
|
||||
|
||||
* 26702: Src/init.c: lexsave()/lexrestore() needed around
|
||||
|
@ -11361,5 +11367,5 @@
|
|||
|
||||
*****************************************************
|
||||
* This is used by the shell to define $ZSH_PATCHLEVEL
|
||||
* $Revision: 1.4606 $
|
||||
* $Revision: 1.4607 $
|
||||
*****************************************************
|
||||
|
|
10
Src/subst.c
10
Src/subst.c
|
@ -2734,7 +2734,7 @@ paramsubst(LinkList l, LinkNode n, char **str, int qt, int ssub)
|
|||
*/
|
||||
if (presc) {
|
||||
int ops = opts[PROMPTSUBST], opb = opts[PROMPTBANG];
|
||||
int opp = opts[PROMPTPERCENT], len;
|
||||
int opp = opts[PROMPTPERCENT];
|
||||
|
||||
if (presc < 2) {
|
||||
opts[PROMPTPERCENT] = 1;
|
||||
|
@ -2756,10 +2756,8 @@ paramsubst(LinkList l, LinkNode n, char **str, int qt, int ssub)
|
|||
ap = aval;
|
||||
for (; *ap; ap++) {
|
||||
char *tmps;
|
||||
unmetafy(*ap, &len);
|
||||
untokenize(*ap);
|
||||
tmps = promptexpand(metafy(*ap, len, META_NOALLOC),
|
||||
0, NULL, NULL, NULL);
|
||||
tmps = promptexpand(*ap, 0, NULL, NULL, NULL);
|
||||
*ap = dupstring(tmps);
|
||||
free(tmps);
|
||||
}
|
||||
|
@ -2767,10 +2765,8 @@ paramsubst(LinkList l, LinkNode n, char **str, int qt, int ssub)
|
|||
char *tmps;
|
||||
if (!copied)
|
||||
val = dupstring(val), copied = 1;
|
||||
unmetafy(val, &len);
|
||||
untokenize(val);
|
||||
tmps = promptexpand(metafy(val, len, META_NOALLOC),
|
||||
0, NULL, NULL, NULL);
|
||||
tmps = promptexpand(val, 0, NULL, NULL, NULL);
|
||||
val = dupstring(tmps);
|
||||
free(tmps);
|
||||
}
|
||||
|
|
|
@ -410,3 +410,20 @@
|
|||
0:Metafied characters in prompt expansion
|
||||
>梶浦由記
|
||||
>Пётр Ильич Чайковский
|
||||
|
||||
(
|
||||
setopt nonomatch
|
||||
tmp1=Ą
|
||||
tmpA=(Ą 'Пётр Ильич Чайковский' 梶浦由記)
|
||||
print ${tmp1} ${(%)tmp1} ${(%%)tmp1}
|
||||
print ${#tmp1} ${#${(%)tmp1}} ${#${(%%)tmp1}}
|
||||
print ${tmpA}
|
||||
print ${(%)tmpA}
|
||||
print ${(%%)tmpA}
|
||||
)
|
||||
0:More metafied characters in prompt expansion
|
||||
>Ą Ą Ą
|
||||
>1 1 1
|
||||
>Ą Пётр Ильич Чайковский 梶浦由記
|
||||
>Ą Пётр Ильич Чайковский 梶浦由記
|
||||
>Ą Пётр Ильич Чайковский 梶浦由記
|
||||
|
|
Loading…
Reference in a new issue