[elm_label] _strbuf_key_value_replace func bug fix
authorHyoyoung Chang <hyoyoung.chang@samsung.com>
Mon, 26 Jul 2010 07:35:01 +0000 (16:35 +0900)
committerHyoyoung Chang <hyoyoung.chang@samsung.com>
Mon, 26 Jul 2010 07:35:01 +0000 (16:35 +0900)
src/lib/elm_entry.c
src/lib/elm_label.c

index 5f371f9..991988d 100644 (file)
@@ -1407,7 +1407,6 @@ _get_value_in_key_string(const char *oldstring, char *key, char **value)
    return -1;
 }
 
-
 static int
 _strbuf_key_value_replace(Eina_Strbuf *srcbuf, char *key, const char *value, int deleteflag)
 {
index 172ed42..ead6299 100644 (file)
@@ -192,7 +192,6 @@ _get_value_in_key_string(const char *oldstring, char *key, char **value)
    return -1;
 }
 
-
 static int
 _strbuf_key_value_replace(Eina_Strbuf *srcbuf, char *key, const char *value, int deleteflag)
 {
@@ -231,21 +230,23 @@ _strbuf_key_value_replace(Eina_Strbuf *srcbuf, char *key, const char *value, int
            eina_strbuf_append_n(repbuf, starttag, tagtxtlen);
            srcstring = eina_strbuf_string_get(repbuf);
            curlocater = strstr(srcstring, key);
+
            if (curlocater != NULL)
              {
                replocater = curlocater + strlen(key) + 1;
-               while (*replocater != '=' && replocater != NULL)
+
+               while (*replocater == ' ' || *replocater == '=')
+                          {
                  replocater++;
-               if (replocater != NULL)
-                 {
-                   replocater++;
-                   while (*replocater != ' ' && *replocater != '>' && replocater == NULL)
-                     replocater++;
-                 }
-               if (replocater != NULL)
+                          }
+
+                while (*replocater != NULL && *replocater != ' ' && *replocater != '>')
+                  replocater++;
+
+               if (replocater-curlocater > strlen(key)+1)
                  {
                    replocater--;
-                   eina_strbuf_append_n(diffbuf, curlocater, replocater-curlocater);
+                   eina_strbuf_append_n(diffbuf, curlocater, replocater-curlocater+1);
                  }
                else
                  insertflag = 1;