X-Git-Url: https://jasonwoof.com/gitweb/?p=st.git;a=blobdiff_plain;f=st.c;fp=st.c;h=39d3fee36017a0fd73301e64f3942d6612315ce5;hp=68dc2be75d8dab4dbfbb094d4f10eafec9c9ace1;hb=288f80cb06b442ef0f55ea62bbceb3260338bf7a;hpb=c9357a8edfe6d047da95b85c5f3c18b9db40d172 diff --git a/st.c b/st.c index 68dc2be..39d3fee 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