Explode terminates in an empty list

This commit is contained in:
Devine Lu Linvega 2024-04-11 09:54:31 -07:00
parent 30690c1d83
commit 819ea2f1fa
1 changed files with 2 additions and 6 deletions

View File

@ -43,12 +43,8 @@ plode(char *s)
if(!depth) return s;
}
} else { /* explode */
*outp_++ = *s++;
if(!spacer(*s)) *outp_++ = ' ';
while((c = *s++) && !spacer(c)) {
*outp_++ = '(', *outp_++ = c, depth++, c = *s;
if(!spacer(c)) *outp_++ = ' ';
}
while((c = *s++) && !spacer(c))
*outp_++ = c, *outp_++ = ' ', *outp_++ = '(', depth++;
for(i = 0; i < depth; i++)
*outp_++ = ')';
}