From: Bruno Haible Date: Sun, 30 Jan 2022 17:46:21 +0000 (+0100) Subject: libtextstyle: Consider setupterm return code. X-Git-Tag: v0.22~214 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4494fc03aebb06c672972abb77745e1e9540842d;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 dfd191046..38490e476 100644 --- a/libtextstyle/gnulib-local/lib/term-ostream.oo.c +++ b/libtextstyle/gnulib-local/lib/term-ostream.oo.c @@ -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");