Explode terminates in an empty list
This commit is contained in:
parent
30690c1d83
commit
819ea2f1fa
|
@ -43,12 +43,8 @@ plode(char *s)
|
||||||
if(!depth) return s;
|
if(!depth) return s;
|
||||||
}
|
}
|
||||||
} else { /* explode */
|
} else { /* explode */
|
||||||
*outp_++ = *s++;
|
while((c = *s++) && !spacer(c))
|
||||||
if(!spacer(*s)) *outp_++ = ' ';
|
*outp_++ = c, *outp_++ = ' ', *outp_++ = '(', depth++;
|
||||||
while((c = *s++) && !spacer(c)) {
|
|
||||||
*outp_++ = '(', *outp_++ = c, depth++, c = *s;
|
|
||||||
if(!spacer(c)) *outp_++ = ' ';
|
|
||||||
}
|
|
||||||
for(i = 0; i < depth; i++)
|
for(i = 0; i < depth; i++)
|
||||||
*outp_++ = ')';
|
*outp_++ = ')';
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue