summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Faure <billiob@gmail.com>2013-06-09 15:36:58 +0200
committerBoris Faure <billiob@gmail.com>2013-06-09 15:50:11 +0200
commite0372fc54d2ac656baabcc4250ba670f9ac95862 (patch)
tree8a5a03252c53ca3f072398433056659cc2e21ad1
parentc979a525536fa2aca0ade28a1f3ff77fb4911639 (diff)
downloadefl-e0372fc54d2ac656baabcc4250ba670f9ac95862.tar.gz
eina_log: screen-256color also support colors
-rw-r--r--src/lib/eina/eina_log.c6
1 files 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);