From: Bruno Haible Date: Sun, 30 Jan 2022 17:46:21 +0000 (+0100) Subject: libtextstyle: Consider setupterm return code. X-Git-Tag: v0.21.1~64 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cd45e16aed444e7c9a996530b79e3e5f02539de4;p=thirdparty%2Fgettext.git libtextstyle: Consider setupterm return code. * libtextstyle/gnulib-local/lib/term-ostream.oo.c (term_ostream_create): Don't bother retrieving values if $TERM is an unknown terminal type. --- diff --git a/libtextstyle/gnulib-local/lib/term-ostream.oo.c b/libtextstyle/gnulib-local/lib/term-ostream.oo.c index ee5abc276..a9ed8ae49 100644 --- a/libtextstyle/gnulib-local/lib/term-ostream.oo.c +++ b/libtextstyle/gnulib-local/lib/term-ostream.oo.c @@ -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");