tFix for multibyte characters in techo. - st - [fork] customized build of st, t… | |
git clone git://src.adamsgaard.dk/st | |
Log | |
Files | |
Refs | |
README | |
LICENSE | |
--- | |
commit c4b79b055df9ef0126f05dd6dbd2bbf935dcb980 | |
parent 7f1e02e4dbb6e6f033797a09a7deea4fe29f2ca6 | |
Author: noname <[email protected]> | |
Date: Fri, 25 Apr 2014 18:28:00 +0400 | |
Fix for multibyte characters in techo. | |
Works for both signed and unsigned char. | |
Diffstat: | |
M st.c | 2 +- | |
1 file changed, 1 insertion(+), 1 deletion(-) | |
--- | |
diff --git a/st.c b/st.c | |
t@@ -2298,7 +2298,7 @@ techo(char *buf, int len) { | |
for(; len > 0; buf++, len--) { | |
char c = *buf; | |
- if(c < 0x20 || c == 0177) { /* control code */ | |
+ if(BETWEEN(c, 0x00, 0x1f) || c == 0x7f) { /* control code */ | |
if(c != '\n' && c != '\r' && c != '\t') { | |
c ^= '\x40'; | |
tputc("^", 1); |