From 549d7d52185166f9e5f0b909b925c72a4cd9f9e2 Mon Sep 17 00:00:00 2001 From: Devine Lu Linvega Date: Fri, 10 May 2024 20:35:49 -0700 Subject: [PATCH] Explode should not include the closing paren --- src/modal.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/modal.c b/src/modal.c index 5447fde..91f31c3 100644 --- a/src/modal.c +++ b/src/modal.c @@ -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))