mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-09-17 02:51:01 +02:00
Small fix to 23177: compute *widthp and *swidep after nicechar().
This commit is contained in:
parent
9b1663b531
commit
07c5aeeb9a
1 changed files with 10 additions and 1 deletions
11
Src/utils.c
11
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;
|
||||
|
|
Loading…
Reference in a new issue