From 55b66a93d7129f529af321b74c50b6985486adea Mon Sep 17 00:00:00 2001 From: Boris Faure Date: Sat, 8 Jun 2013 21:06:08 +0200 Subject: [PATCH] =?UTF-8?q?eina-log:=20xterm-256=20(or=20terminology=20som?= =?UTF-8?q?eday=E2=80=A6)=20supports=20colors?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 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 5e39de6b1e..524df6d62b 100644 --- a/src/lib/eina/eina_log.c +++ b/src/lib/eina/eina_log.c @@ -1177,6 +1177,7 @@ static inline Eina_Bool eina_log_term_color_supported(const char *term) { const char *tail; + size_t len; if (!term) return EINA_FALSE; @@ -1188,10 +1189,11 @@ eina_log_term_color_supported(const char *term) * take from gentoo's portage. */ - case 'x': /* xterm and xterm-color */ + case 'x': /* xterm and xterm-(256)color */ + len = strlen(term); return ((strncmp(tail, "term", sizeof("term") - 1) == 0) && ((tail[sizeof("term") - 1] == '\0') || - (strcmp(tail + sizeof("term") - 1, "-color") == 0))); + (strcmp(term + len - sizeof("color") + 1, "color") == 0))); case 'E': /* Eterm */ case 'a': /* aterm */