X-Git-Url: https://git.danieliu.xyz/?a=blobdiff_plain;f=st.c;h=2a565b6e96e7d1c3692a2dd5ed18331981a24b37;hb=9619760e129b0994cd3bc4c827c83960f6a5e98f;hp=79bb6aa63b5d745543c830cdec8bc8e655cbecf0;hpb=b0310fba5de0c519eae0c8a2817ccc7bfcdd5222;p=st.git diff --git a/st.c b/st.c index 79bb6aa..2a565b6 100644 --- a/st.c +++ b/st.c @@ -2444,21 +2444,19 @@ tdectest(char c) { void tstrsequence(uchar c) { - if (c & 0x80) { - switch (c) { - case 0x90: /* DCS -- Device Control String */ - c = 'P'; - break; - case 0x9f: /* APC -- Application Program Command */ - c = '_'; - break; - case 0x9e: /* PM -- Privacy Message */ - c = '^'; - break; - case 0x9d: /* OSC -- Operating System Command */ - c = ']'; - break; - } + switch (c) { + case 0x90: /* DCS -- Device Control String */ + c = 'P'; + break; + case 0x9f: /* APC -- Application Program Command */ + c = '_'; + break; + case 0x9e: /* PM -- Privacy Message */ + c = '^'; + break; + case 0x9d: /* OSC -- Operating System Command */ + c = ']'; + break; } strreset(); strescseq.type = c; @@ -2785,10 +2783,8 @@ tresize(int col, int row) { free(term.line[i]); free(term.alt[i]); } - if(i > 0) { - memmove(term.line, term.line + i, row * sizeof(Line)); - memmove(term.alt, term.alt + i, row * sizeof(Line)); - } + memmove(term.line, term.line + i, row * sizeof(Line)); + memmove(term.alt, term.alt + i, row * sizeof(Line)); for(i += row; i < term.row; i++) { free(term.line[i]); free(term.alt[i]); @@ -4012,7 +4008,6 @@ usage(void) { int main(int argc, char *argv[]) { - char *titles; uint cols = 80, rows = 24; xw.l = xw.t = 0; @@ -4030,10 +4025,8 @@ main(int argc, char *argv[]) { /* eat all remaining arguments */ if(argc > 1) { opt_cmd = &argv[1]; - if(argv[1] != NULL && opt_title == NULL) { - titles = xstrdup(argv[1]); - opt_title = basename(titles); - } + if(argv[1] != NULL && opt_title == NULL) + opt_title = basename(xstrdup(argv[1])); } goto run; case 'f':