billiob pushed a commit to branch master.

commit e0372fc54d2ac656baabcc4250ba670f9ac95862
Author: Boris Faure <[email protected]>
Date:   Sun Jun 9 15:36:58 2013 +0200

    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 524df6d..dbdec6f 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);

-- 

------------------------------------------------------------------------------
How ServiceNow helps IT people transform IT departments:
1. A cloud service to automate IT design, transition and operations
2. Dashboards that offer high-level views of enterprise services
3. A single system of record for all IT processes
http://p.sf.net/sfu/servicenow-d2d-j

Reply via email to