]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
libtextstyle: Recognize number of colours in TERM=*-direct.
authorBruno Haible <bruno@clisp.org>
Fri, 3 Jan 2025 01:16:38 +0000 (02:16 +0100)
committerBruno Haible <bruno@clisp.org>
Fri, 3 Jan 2025 01:16:38 +0000 (02:16 +0100)
* libtextstyle/gnulib-local/lib/term-ostream.oo.c (term_ostream_create): Fix
recognition of TERM values that end in "-direct".

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

index a10517d4cf61e7b072f5a46e00b8ddfa4a778173..932231459f053b9f9230f70e79f3409e678353a6 100644 (file)
@@ -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,
                   <https://github.com/termstandard/colors> recommends to test
                   getenv ("COLORTERM"), but it does not seem like a good idea.