about summary refs log tree commit diff
path: root/Src/utils.c
diff options
context:
space:
mode:
authorJun-ichi Takimoto <takimoto-j@kba.biglobe.ne.jp>2020-03-17 15:04:12 +0900
committerJun-ichi Takimoto <takimoto-j@kba.biglobe.ne.jp>2020-03-17 15:11:04 +0900
commit0bc1edef5a1297a2389a480ea0436d2d9ff0392c (patch)
treee43c0c40677b45c1b57d133294c6980f6833242d /Src/utils.c
parente5765bfdc89f131d03051ba4963819fdfe252503 (diff)
downloadzsh-0bc1edef5a1297a2389a480ea0436d2d9ff0392c.tar.gz
zsh-0bc1edef5a1297a2389a480ea0436d2d9ff0392c.tar.xz
zsh-0bc1edef5a1297a2389a480ea0436d2d9ff0392c.zip
45536: fix handling of 8bit character under C-locale
correctly escape unprintable 8bit character by using \M-
Diffstat (limited to 'Src/utils.c')
-rw-r--r--Src/utils.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/Src/utils.c b/Src/utils.c
index f9c2d4a2b..339404489 100644
--- a/Src/utils.c
+++ b/Src/utils.c
@@ -711,7 +711,7 @@ wcs_nicechar_sel(wchar_t c, size_t *widthp, char **swidep, int quotable)
 	    if (widthp)
 		*widthp = 6;
 	} else {
-	    strcpy(buf, nicechar((int)c));
+	    strcpy(buf, nicechar_sel((int)c, quotable));
 	    /*
 	     * There may be metafied characters from nicechar(),
 	     * so compute width and end position independently.
@@ -771,7 +771,7 @@ mod_export int is_wcs_nicechar(wchar_t c)
 	if (c == 0x7f || c == L'\n' || c == L'\t' || c < 0x20)
 	    return 1;
 	if (c >= 0x80) {
-	    return (c >= 0x100);
+	    return (c >= 0x100 || is_nicechar((int)c));
 	}
     }
     return 0;