From: Bruno Haible Date: Fri, 3 Jan 2025 01:16:38 +0000 (+0100) Subject: libtextstyle: Recognize number of colours in TERM=*-direct. X-Git-Tag: v0.24~68 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=59d882f4d0d45d43eefde630bce29165ca2b8f0b;p=thirdparty%2Fgettext.git libtextstyle: Recognize number of colours in TERM=*-direct. * libtextstyle/gnulib-local/lib/term-ostream.oo.c (term_ostream_create): Fix recognition of TERM values that end in "-direct". --- diff --git a/libtextstyle/gnulib-local/lib/term-ostream.oo.c b/libtextstyle/gnulib-local/lib/term-ostream.oo.c index a10517d4c..932231459 100644 --- a/libtextstyle/gnulib-local/lib/term-ostream.oo.c +++ b/libtextstyle/gnulib-local/lib/term-ostream.oo.c @@ -2683,8 +2683,8 @@ term_ostream_create (int fd, const char *filename, ttyctl_t tty_control) (strlen (term) > 9 && strcmp (term + strlen (term) - 9, "-256color") == 0) || /* Recognize *-direct. */ - (strlen (term) > 8 - && strcmp (term + strlen (term) - 8, "-direct") == 0)) + (strlen (term) > 7 + && strcmp (term + strlen (term) - 7, "-direct") == 0)) ? (/* Note: For recognizing cm_xtermrgb, recommends to test getenv ("COLORTERM"), but it does not seem like a good idea.