summary refs log tree commit diff
path: root/Src/utils.c
diff options
context:
space:
mode:
authorBart Schaefer <barts@users.sourceforge.net>2007-02-26 18:47:25 +0000
committerBart Schaefer <barts@users.sourceforge.net>2007-02-26 18:47:25 +0000
commit07c5aeeb9a85d63fb15bd38b82fa55671b039ead (patch)
tree0ccb05113a328c8754e30a6b230e84a8a0778f38 /Src/utils.c
parent9b1663b5313ac1ef0935a0f1f159fc1a1d0103d9 (diff)
downloadzsh-07c5aeeb9a85d63fb15bd38b82fa55671b039ead.tar.gz
zsh-07c5aeeb9a85d63fb15bd38b82fa55671b039ead.tar.xz
zsh-07c5aeeb9a85d63fb15bd38b82fa55671b039ead.zip
Small fix to 23177: compute *widthp and *swidep after nicechar().
Diffstat (limited to 'Src/utils.c')
-rw-r--r--Src/utils.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/Src/utils.c b/Src/utils.c
index e6eb69f01..0e8404209 100644
--- a/Src/utils.c
+++ b/Src/utils.c
@@ -519,7 +519,16 @@ wcs_nicechar(wchar_t c, size_t *widthp, char **swidep)
 	    if (widthp)
 		*widthp = 6;
 	} else {
-	    return nicechar((int)c);
+	    strcpy(buf, nicechar((int)c));
+	    /*
+	     * There may be metafied characters from nicechar(),
+	     * so compute width and end position independently.
+	     */
+	    if (widthp)
+		*widthp = ztrlen(buf);
+	    if (swidep)
+	      *swidep = buf + strlen(buf);
+	    return buf;
 	}
 	if (swidep)
 	    *swidep = buf + *widthp;