mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-10-13 11:21:13 +02:00
26705: multibyte characters with Meta in ${(%)foo} etc.
This commit is contained in:
parent
6f3f3c6a01
commit
e391f09457
3 changed files with 27 additions and 8 deletions
|
@ -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>
|
2009-03-09 Peter Stephenson <pws@csr.com>
|
||||||
|
|
||||||
* 26702: Src/init.c: lexsave()/lexrestore() needed around
|
* 26702: Src/init.c: lexsave()/lexrestore() needed around
|
||||||
|
@ -11361,5 +11367,5 @@
|
||||||
|
|
||||||
*****************************************************
|
*****************************************************
|
||||||
* This is used by the shell to define $ZSH_PATCHLEVEL
|
* 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) {
|
if (presc) {
|
||||||
int ops = opts[PROMPTSUBST], opb = opts[PROMPTBANG];
|
int ops = opts[PROMPTSUBST], opb = opts[PROMPTBANG];
|
||||||
int opp = opts[PROMPTPERCENT], len;
|
int opp = opts[PROMPTPERCENT];
|
||||||
|
|
||||||
if (presc < 2) {
|
if (presc < 2) {
|
||||||
opts[PROMPTPERCENT] = 1;
|
opts[PROMPTPERCENT] = 1;
|
||||||
|
@ -2756,10 +2756,8 @@ paramsubst(LinkList l, LinkNode n, char **str, int qt, int ssub)
|
||||||
ap = aval;
|
ap = aval;
|
||||||
for (; *ap; ap++) {
|
for (; *ap; ap++) {
|
||||||
char *tmps;
|
char *tmps;
|
||||||
unmetafy(*ap, &len);
|
|
||||||
untokenize(*ap);
|
untokenize(*ap);
|
||||||
tmps = promptexpand(metafy(*ap, len, META_NOALLOC),
|
tmps = promptexpand(*ap, 0, NULL, NULL, NULL);
|
||||||
0, NULL, NULL, NULL);
|
|
||||||
*ap = dupstring(tmps);
|
*ap = dupstring(tmps);
|
||||||
free(tmps);
|
free(tmps);
|
||||||
}
|
}
|
||||||
|
@ -2767,10 +2765,8 @@ paramsubst(LinkList l, LinkNode n, char **str, int qt, int ssub)
|
||||||
char *tmps;
|
char *tmps;
|
||||||
if (!copied)
|
if (!copied)
|
||||||
val = dupstring(val), copied = 1;
|
val = dupstring(val), copied = 1;
|
||||||
unmetafy(val, &len);
|
|
||||||
untokenize(val);
|
untokenize(val);
|
||||||
tmps = promptexpand(metafy(val, len, META_NOALLOC),
|
tmps = promptexpand(val, 0, NULL, NULL, NULL);
|
||||||
0, NULL, NULL, NULL);
|
|
||||||
val = dupstring(tmps);
|
val = dupstring(tmps);
|
||||||
free(tmps);
|
free(tmps);
|
||||||
}
|
}
|
||||||
|
|
|
@ -410,3 +410,20 @@
|
||||||
0:Metafied characters in prompt expansion
|
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