diff options
author | Hiltjo Posthuma <hiltjo@codemadness.org> | 2019-03-15 14:44:28 +0100 |
---|---|---|
committer | Hiltjo Posthuma <hiltjo@codemadness.org> | 2019-03-15 14:47:08 +0100 |
commit | b650256044f867851725f712fdac58d4ff294808 (patch) | |
tree | 01a3b4bbc45eddde510861a8fc6540a69b2596bb /st.c | |
parent | 9acec468fbeaa9f90578352b610431ca9b2d4ee4 (diff) | |
download | st-patched-b650256044f867851725f712fdac58d4ff294808.tar.bz2 st-patched-b650256044f867851725f712fdac58d4ff294808.tar.xz st-patched-b650256044f867851725f712fdac58d4ff294808.zip |
dont print color warning on color reset OSC 104 without parameter
also print explicitly "(null)" when printf "%s" p=NULL.
noticed when exiting mutt: printf '\x1b]104\x07'
Diffstat (limited to 'st.c')
-rw-r--r-- | st.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -1865,7 +1865,10 @@ strhandle(void) | |||
1865 | case 104: /* color reset, here p = NULL */ | 1865 | case 104: /* color reset, here p = NULL */ |
1866 | j = (narg > 1) ? atoi(strescseq.args[1]) : -1; | 1866 | j = (narg > 1) ? atoi(strescseq.args[1]) : -1; |
1867 | if (xsetcolorname(j, p)) { | 1867 | if (xsetcolorname(j, p)) { |
1868 | fprintf(stderr, "erresc: invalid color %s\n", p); | 1868 | if (par == 104 && narg <= 1) |
1869 | return; /* color reset without parameter */ | ||
1870 | fprintf(stderr, "erresc: invalid color j=%d, p=%s\n", | ||
1871 | j, p ? p : "(null)"); | ||
1869 | } else { | 1872 | } else { |
1870 | /* | 1873 | /* |
1871 | * TODO if defaultbg color is changed, borders | 1874 | * TODO if defaultbg color is changed, borders |