Hi, I think the loop is simpler without the int c variable.
Cheers,
Truls
---
st.c | 10 +++-------
1 file changed, 3 insertions(+), 7 deletions(-)
diff --git a/st.c b/st.c
index 39d3fee..9f29130 100644
--- a/st.c
+++ b/st.c
@@ -2272,20 +2272,16 @@ strhandle(void) {
void
strparse(void) {
- int c;
char *p = strescseq.buf;
strescseq.narg = 0;
strescseq.buf[strescseq.len] = '\0';
- if(*p == '\0')
- return;
-
- while(strescseq.narg < STR_ARG_SIZ) {
+ while(*p && strescseq.narg < STR_ARG_SIZ) {
strescseq.args[strescseq.narg++] = p;
- while((c = *p) != ';' && c != '\0')
+ while(*p && *p != ';')
++p;
- if(c == '\0')
+ if(!*p)
return;
*p++ = '\0';
}
--
1.8.4