about summary refs log tree commit diff
path: root/Src/subst.c
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2007-02-10 22:12:58 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2007-02-10 22:12:58 +0000
commit0a532a8f7fc5144aa8d92bda5b0d5d3acf38cc0c (patch)
tree62204a23ab6f208e6d73ec61a4266b9436dc3e0d /Src/subst.c
parent471184c7c2f2d8e18ebc60bfefe99b200ac6ff45 (diff)
downloadzsh-0a532a8f7fc5144aa8d92bda5b0d5d3acf38cc0c.tar.gz
zsh-0a532a8f7fc5144aa8d92bda5b0d5d3acf38cc0c.tar.xz
zsh-0a532a8f7fc5144aa8d92bda5b0d5d3acf38cc0c.zip
fix metafication of ${(#)x}
Diffstat (limited to 'Src/subst.c')
-rw-r--r--Src/subst.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/Src/subst.c b/Src/subst.c
index be7b5321c..acd121e78 100644
--- a/Src/subst.c
+++ b/Src/subst.c
@@ -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 */