tasn pushed a commit to branch edje-1.7.

commit 858052f9651a7eb2244ec218b606adf4d5ea3d9f
Author: Tom Hacohen <[email protected]>
Date:   Thu May 16 11:11:41 2013 +0100

    Edje textblock: Fixed issue with quoted formats.
---
 ChangeLog                       |  4 +++
 NEWS                            |  8 ++++++
 src/lib/edje_textblock_styles.c | 61 ++++++++++++++++++++---------------------
 3 files changed, 42 insertions(+), 31 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 6b83e09..c1aa86c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -702,3 +702,7 @@
 2013-05-08  Mike Blumenkrantz
 
         * Edje: fix custom states for proxy parts
+
+2013-05-16  Tom Hacohen (TAsn)
+
+        * Edje textblock: Fixed issue with quoted formats.
diff --git a/NEWS b/NEWS
index 08134d7..86e6268 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,11 @@
+Edje 1.7.8
+
+Changes since Edje 1.7.7:
+-------------------------
+
+Fixes:
+    * Edje textblock: Fixed issue with quoted formats.
+
 Edje 1.7.7
 
 Changes since Edje 1.7.6:
diff --git a/src/lib/edje_textblock_styles.c b/src/lib/edje_textblock_styles.c
index bf7f330..6500ffa 100644
--- a/src/lib/edje_textblock_styles.c
+++ b/src/lib/edje_textblock_styles.c
@@ -25,44 +25,43 @@ _edje_format_param_parse(char *item, char **key, char **val)
 static char *
 _edje_format_parse(const char **s)
 {
-   char *item, *ds;
-   const char *p, *ss;
+   const char *p;
    const char *s1 = NULL;
    const char *s2 = NULL;
+   Eina_Bool quote = EINA_FALSE;
 
    p = *s;
    if ((!p) || (*p == 0)) return NULL;
    for (;;)
      {
-       if (!s1)
-         {
-            if (*p != ' ') s1 = p;
-            if (*p == 0) break;
-         }
-       else if (!s2)
-         {
-            if ((p > *s) && (p[-1] != '\\'))
-              {
-                 if (*p == ' ') s2 = p;
-              }
-            if (*p == 0) s2 = p;
-         }
-       p++;
-       if (s1 && s2)
-         {
-            item = malloc(s2 - s1 + 1);
-            if (item)
-              {
-                 for (ds = item, ss = s1; ss < s2; ss++, ds++)
-                   {
-                      if ((*ss == '\\') && (ss < (s2 - 1))) ss++;
-                      *ds = *ss;
-                   }
-                 *ds = 0;
-              }
-            *s = s2;
-            return item;
-         }
+        if (!s1)
+          {
+             if (*p != ' ') s1 = p;
+             if (*p == 0) break;
+          }
+        else if (!s2)
+          {
+             if (*p == '\'')
+               {
+                  quote = !quote;
+               }
+
+             if ((p > *s) && (p[-1] != '\\') && (!quote))
+               {
+                  if (*p == ' ') s2 = p;
+               }
+             if (*p == 0) s2 = p;
+          }
+        p++;
+        if (s1 && s2 && (s2 > s1))
+          {
+             size_t len = s2 - s1;
+             char *ret = malloc(len + 1);
+             memcpy(ret, s1, len);
+             ret[len] = '\0';
+             *s = s2;
+             return ret;
+          }
      }
    *s = p;
    return NULL;

-- 

------------------------------------------------------------------------------
AlienVault Unified Security Management (USM) platform delivers complete
security visibility with the essential security capabilities. Easily and
efficiently configure, manage, and operate all of your security controls
from a single console and one unified framework. Download a free trial.
http://p.sf.net/sfu/alienvault_d2d

Reply via email to