diff options
-rw-r--r-- | ChangeLog | 8 | ||||
-rw-r--r-- | Src/subst.c | 10 | ||||
-rw-r--r-- | Test/D07multibyte.ztst | 17 |
3 files changed, 27 insertions, 8 deletions
diff --git a/ChangeLog b/ChangeLog index ee5fec451..f6250b694 100644 --- a/ChangeLog +++ b/ChangeLog @@ -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 $ ***************************************************** diff --git a/Src/subst.c b/Src/subst.c index 89e9e46eb..9e3f06fe3 100644 --- a/Src/subst.c +++ b/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); } diff --git a/Test/D07multibyte.ztst b/Test/D07multibyte.ztst index 1d440ee30..fb3161d97 100644 --- a/Test/D07multibyte.ztst +++ b/Test/D07multibyte.ztst @@ -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 +>Ą Пётр Ильич Чайковский 梶浦由記 +>Ą Пётр Ильич Чайковский 梶浦由記 +>Ą Пётр Ильич Чайковский 梶浦由記 |