]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
libtextstyle: Consider setupterm return code.
authorBruno Haible <bruno@clisp.org>
Sun, 30 Jan 2022 17:46:21 +0000 (18:46 +0100)
committerBruno Haible <bruno@clisp.org>
Sun, 9 Oct 2022 07:30:42 +0000 (09:30 +0200)
* libtextstyle/gnulib-local/lib/term-ostream.oo.c (term_ostream_create): Don't
bother retrieving values if $TERM is an unknown terminal type.

libtextstyle/gnulib-local/lib/term-ostream.oo.c

index ee5abc27655fc9f9a35e886e7a269a0593c1161e..a9ed8ae490dfba0f641c240b99e656a39078db34 100644 (file)
@@ -2499,7 +2499,7 @@ term_ostream_create (int fd, const char *filename, ttyctl_t tty_control)
           #if HAVE_TERMINFO
           int err = 1;
 
-          if (setupterm (term, fd, &err) || err == 1)
+          if (setupterm (term, fd, &err) == 0 || err == 1)
             {
               /* Retrieve particular values depending on the terminal type.  */
               stream->max_colors = tigetnum ("colors");