From f0ee3d7fb3390b1c0a1293bfd034242872198845 Mon Sep 17 00:00:00 2001 From: Ken Hornstein Date: Thu, 2 Jan 2014 15:04:17 -0500 Subject: [PATCH] Always emit an STR instruction for terminal escape sequences, otherwise you can get unintended results (like printint the previous contents of the str register, which is almost certainly what you don't want). --- sbr/fmt_compile.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/sbr/fmt_compile.c b/sbr/fmt_compile.c index 4ae85bc9..c4476f8d 100644 --- a/sbr/fmt_compile.c +++ b/sbr/fmt_compile.c @@ -1119,19 +1119,20 @@ get_term_stringcap(struct ftable *t, char *cap) if (termstatus == 0) initialize_terminfo(); + termcbufp = termcbuf; + if (termstatus == -1) - return; + goto out; parm = tigetstr(cap); if (parm == (char *) -1 || parm == NULL) { - return; + goto out; } - termcbufp = termcbuf; - tputs(parm, 1, termbytes); +out: termcbufp = '\0'; LS(t->f_type, termcbuf); -- 2.56.0