From e0372fc54d2ac656baabcc4250ba670f9ac95862 Mon Sep 17 00:00:00 2001 From: Boris Faure Date: Sun, 9 Jun 2013 15:36:58 +0200 Subject: [PATCH] eina_log: screen-256color also support colors --- src/lib/eina/eina_log.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/lib/eina/eina_log.c b/src/lib/eina/eina_log.c index 524df6d62b..dbdec6f211 100644 --- a/src/lib/eina/eina_log.c +++ b/src/lib/eina/eina_log.c @@ -1182,6 +1182,7 @@ eina_log_term_color_supported(const char *term) if (!term) return EINA_FALSE; + len = strlen(term); tail = term + 1; switch (term[0]) { @@ -1190,7 +1191,6 @@ eina_log_term_color_supported(const char *term) */ case 'x': /* xterm and xterm-(256)color */ - len = strlen(term); return ((strncmp(tail, "term", sizeof("term") - 1) == 0) && ((tail[sizeof("term") - 1] == '\0') || (strcmp(term + len - sizeof("color") + 1, "color") == 0))); @@ -1206,7 +1206,9 @@ eina_log_term_color_supported(const char *term) (strcmp(tail + sizeof("xvt") - 1, "-unicode") == 0))); case 's': /* screen */ - return (strcmp(tail, "creen") == 0); + return ((strncmp(tail, "creen", sizeof("creen") - 1) == 0) && + ((tail[sizeof("creen") - 1] == '\0') || + (strcmp(term + len - sizeof("color") + 1, "color") == 0))); case 'g': /* gnome */ return (strcmp(tail, "nome") == 0);