tasn pushed a commit to branch evas-1.7.
commit a57b73a545e05c45d038b2685a1aa807b651cc60
Author: Tom Hacohen <[email protected]>
Date: Mon Jul 1 14:16:31 2013 +0100
Evas textblock: Fixed format parsing to not be confused by single-quotes.
Before this commit, having a single quote anywhere in the format
would mess up all of the format parsing.
Thanks to MinSu Seo for reporting.
---
ChangeLog | 4 ++++
NEWS | 1 +
src/lib/canvas/evas_object_textblock.c | 12 ++++++++----
3 files changed, 13 insertions(+), 4 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index f37a14b..c46d1f5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1324,3 +1324,7 @@
* Evas/Wayland_EGL: Force EGL_PLATFORM to wayland to skip
autodetection.
+
+2013-07-01 Tom Hacohen
+
+ * Evas textblock: Fixed issue when parsing formats with quotes.
diff --git a/NEWS b/NEWS
index 12911c2..0832e02 100644
--- a/NEWS
+++ b/NEWS
@@ -7,6 +7,7 @@ Fixes:
* Correctly detect if a loader support asynchronous preloading.
* Fix memory leak in evas textgrid
* Evas: Fix evas_common_convert_yuv_42* functions to actually return the
converted data.
+ * Evas textblock: Fixed issue when parsing formats with quotes.
Evas 1.7.7
diff --git a/src/lib/canvas/evas_object_textblock.c
b/src/lib/canvas/evas_object_textblock.c
index 531fc2e..2c0e01f 100644
--- a/src/lib/canvas/evas_object_textblock.c
+++ b/src/lib/canvas/evas_object_textblock.c
@@ -2278,15 +2278,19 @@ _format_is_param(const char *item)
static void
_format_param_parse(const char *item, const char **key, const char **val)
{
- const char *start, *end, *quote;
+ const char *start, *end;
start = strchr(item, '=');
*key = eina_stringshare_add_length(item, start - item);
start++; /* Advance after the '=' */
- /* If we can find a quote, our new delimiter is a quote, not a space. */
- if ((quote = strchr(start, '\'')))
+ /* If we can find a quote as the first non-space char,
+ * our new delimiter is a quote, not a space. */
+ while (*start == ' ')
+ start++;
+
+ if (*start == '\'')
{
- start = quote + 1;
+ start++;
end = strchr(start, '\'');
while ((end) && (end > start) && (end[-1] == '\\'))
end = strchr(end + 1, '\'');
--
------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:
Build for Windows Store.
http://p.sf.net/sfu/windows-dev2dev