1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-10-23 04:30:24 +02:00

fix metafication of ${(#)x}

This commit is contained in:
Peter Stephenson 2007-02-10 22:12:58 +00:00
parent 471184c7c2
commit 0a532a8f7f
3 changed files with 46 additions and 4 deletions

View file

@ -1193,21 +1193,25 @@ static char *
substevalchar(char *ptr)
{
zlong ires = mathevali(ptr);
int len;
if (errflag)
return NULL;
#ifdef MULTIBYTE_SUPPORT
if (isset(MULTIBYTE) && ires > 127) {
char buf[10];
int dummy;
/* inefficient: should separate out \U handling from getkeystring */
sprintf(buf, "\\U%.8x", (unsigned int)ires);
return getkeystring(buf, &dummy, GETKEYS_BINDKEY, NULL);
} else {
ptr = getkeystring(buf, &len, GETKEYS_BINDKEY, NULL);
} else
#endif
{
ptr = zhalloc(2);
len = 1;
sprintf(ptr, "%c", (int)ires);
return ptr;
}
return metafy(ptr, len, META_USEHEAP);
}
/* parameter substitution */