Check for ?: register value before transform

This commit is contained in:
Devine Lu Linvega 2024-04-08 20:23:58 -07:00
parent 16a1617820
commit 21ec6b9e6a
1 changed files with 10 additions and 10 deletions

View File

@ -73,16 +73,16 @@ put_reg(char r)
char *s = regs[(int)r]; char *s = regs[(int)r];
if(r == '*') if(r == '*')
s = plode(s); s = plode(s);
else if(r == ':') { else if(s) {
char *bb = walk(s); char *ss = walk(s);
if(*s == '(') s++, --bb; if(r == ':') {
while(s < bb) { if(*s == '(') s++, --ss;
while(s < ss) {
char c = *(s++); char c = *(s++);
if(c == '\\' && *(s++) == 'n') c = 0xa; if(c == '\\' && *(s++) == 'n') c = 0xa;
putc(c, stdout); putc(c, stdout);
} }
} else if(s) { } else
char *ss = walk(s);
while((s < ss)) *outp_++ = *s++; while((s < ss)) *outp_++ = *s++;
} else } else
*outp_++ = r; *outp_++ = r;