1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2024-06-01 04:46:08 +02:00

26705: multibyte characters with Meta in ${(%)foo} etc.

This commit is contained in:
Peter Stephenson 2009-03-10 11:12:02 +00:00
parent 6f3f3c6a01
commit e391f09457
3 changed files with 27 additions and 8 deletions

View File

@ -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 $
*****************************************************

View File

@ -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);
}

View File

@ -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
>Ą Пётр Ильич Чайковский 梶浦由記
>Ą Пётр Ильич Чайковский 梶浦由記
>Ą Пётр Ильич Чайковский 梶浦由記