From 42fd486a41f4abaf30fb236f11ea60e890827faa Mon Sep 17 00:00:00 2001 From: Devine Lu Linvega Date: Sat, 13 Apr 2024 16:22:37 -0700 Subject: [PATCH] Do not walk twice for explode --- src/modal.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/modal.c b/src/modal.c index a414cce..bb71d33 100644 --- a/src/modal.c +++ b/src/modal.c @@ -47,16 +47,14 @@ put_reg(char r) { char c, *s = regs[(int)r]; if(r == '~') { - char buf; /* special stdin */ - while(fread(&buf, 1, 1, stdin) && buf >= ' ') - *outp_++ = buf; + while(fread(&c, 1, 1, stdin) && c >= ' ') + *outp_++ = c; } else if(s) { char *ss = walk(s); if(r == '*') { /* special implode */ if(*s == '(') { - ss = walk(s); while(s < ss && (c = *s++)) if(!spacer(c)) *outp_++ = c; }