Explode should not include the closing paren

This commit is contained in:
Devine Lu Linvega 2024-05-10 20:35:49 -07:00
parent 8d49821fdd
commit 549d7d5218
1 changed files with 2 additions and 3 deletions

View File

@ -145,11 +145,10 @@ write_reg(char r, char *reg)
char c, *cap = walk(reg);
if(*reg == '(' && reg[1] != ')') { /* tuple */
reg++;
while(reg < cap) {
while(reg < cap - 1) {
while((c = *reg) && !spacer(c))
*dst_++ = c, reg++;
*dst_++ = ' ';
*dst_++ = '(', reg++, depth++;
*dst_++ = ' ', *dst_++ = '(', reg++, depth++;
}
} else /* token */
while((c = *reg++) && !spacer(c))