From 21ec6b9e6a55f03701b5b777029024f71ca68d13 Mon Sep 17 00:00:00 2001 From: Devine Lu Linvega Date: Mon, 8 Apr 2024 20:23:58 -0700 Subject: [PATCH] Check for ?: register value before transform --- src/modal.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/modal.c b/src/modal.c index 45ce9a8..d9290d4 100644 --- a/src/modal.c +++ b/src/modal.c @@ -73,17 +73,17 @@ put_reg(char r) char *s = regs[(int)r]; if(r == '*') s = plode(s); - else if(r == ':') { - char *bb = walk(s); - if(*s == '(') s++, --bb; - while(s < bb) { - char c = *(s++); - if(c == '\\' && *(s++) == 'n') c = 0xa; - putc(c, stdout); - } - } else if(s) { + else if(s) { char *ss = walk(s); - while((s < ss)) *outp_++ = *s++; + if(r == ':') { + if(*s == '(') s++, --ss; + while(s < ss) { + char c = *(s++); + if(c == '\\' && *(s++) == 'n') c = 0xa; + putc(c, stdout); + } + } else + while((s < ss)) *outp_++ = *s++; } else *outp_++ = r; return 1;