mirror of
https://github.com/alrayyes/st.git
synced 2024-11-22 19:26:22 +00:00
Simplify techo
Remove special case for \e because it is handled well by "control code" case.
This commit is contained in:
parent
dc74c4f729
commit
4ad2fc7f18
1 changed files with 1 additions and 4 deletions
5
st.c
5
st.c
|
@ -2318,10 +2318,7 @@ techo(char *buf, int len) {
|
||||||
for(; len > 0; buf++, len--) {
|
for(; len > 0; buf++, len--) {
|
||||||
char c = *buf;
|
char c = *buf;
|
||||||
|
|
||||||
if(c == '\033') { /* escape */
|
if(c < '\x20') { /* control code */
|
||||||
tputc("^", 1);
|
|
||||||
tputc("[", 1);
|
|
||||||
} else if(c < '\x20') { /* control code */
|
|
||||||
if(c != '\n' && c != '\r' && c != '\t') {
|
if(c != '\n' && c != '\r' && c != '\t') {
|
||||||
c |= '\x40';
|
c |= '\x40';
|
||||||
tputc("^", 1);
|
tputc("^", 1);
|
||||||
|
|
Loading…
Reference in a new issue