]> 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, 30 Jan 2022 17:46:21 +0000 (18:46 +0100)
* 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 dfd1910468c6f83ecfad1cbb5e2be056540cfa08..38490e4769e91bcb6fbfa2643af97e8d551369ad 100644 (file)
@@ -2501,7 +2501,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");