X-Git-Url: https://git.danieliu.xyz/?a=blobdiff_plain;f=st.c;h=827ed08555eb39a359a9ecd5a8e1059a89d83266;hb=69d1fe06a97619e80872aaae2c4c97ced0540b67;hp=68dc2be75d8dab4dbfbb094d4f10eafec9c9ace1;hpb=c9357a8edfe6d047da95b85c5f3c18b9db40d172;p=st.git diff --git a/st.c b/st.c index 68dc2be..827ed08 100644 --- a/st.c +++ b/st.c @@ -2272,12 +2272,23 @@ strhandle(void) { void strparse(void) { + int c; char *p = strescseq.buf; strescseq.narg = 0; strescseq.buf[strescseq.len] = '\0'; - while(p && strescseq.narg < STR_ARG_SIZ) - strescseq.args[strescseq.narg++] = strsep(&p, ";"); + + if(*p == '\0') + return; + + while(strescseq.narg < STR_ARG_SIZ) { + strescseq.args[strescseq.narg++] = p; + while((c = *p) != ';' && c != '\0') + ++p; + if(c == '\0') + return; + *p++ = '\0'; + } } void @@ -2652,7 +2663,7 @@ tputc(char *c, int len) { * character. */ if(term.esc & ESC_STR) { - if(width == 1 && + if(len == 1 && (ascii == '\a' || ascii == 030 || ascii == 032 || ascii == 033 || ISCONTROLC1(unicodep))) {