aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeeyong Um <conr2d@gmail.com>2017-11-10 12:59:55 +0900
committerJeeyong Um <conr2d@gmail.com>2017-11-10 12:59:55 +0900
commit7c0f1fdd34186220ca01d6b52b02b94cf6db9962 (patch)
tree700bcbe2a732603f137e4cedd5b53ce6b3ccedeb
parentcxx: Fix example for GCC (diff)
downloadefl-devs/jpeg/items.tar.gz
edje_cc: Extract function to build stack ending with wildcarddevs/jpeg/items
-rw-r--r--src/bin/edje/edje_cc_parse.c45
1 files changed, 23 insertions, 22 deletions
diff --git a/src/bin/edje/edje_cc_parse.c b/src/bin/edje/edje_cc_parse.c
index f3afd8a5e7..d8a7802e87 100644
--- a/src/bin/edje/edje_cc_parse.c
+++ b/src/bin/edje/edje_cc_parse.c
@@ -188,6 +188,23 @@ fill_object_statement_hashes(void)
}
}
+static char *
+stack_dup_wildcard(void)
+{
+ char buf[PATH_MAX] = { 0, };
+ char *end;
+
+ strncpy(buf, stack_id(), sizeof(buf) - 1);
+
+ end = strrchr(buf, '.');
+ if (end) end++;
+ else end = buf;
+
+ strcpy(end, "*");
+
+ return eina_strdup(buf);
+}
+
static void
new_object(void)
{
@@ -219,17 +236,9 @@ new_object(void)
sh = eina_hash_find(_new_statement_short_single_hash, id);
if (!sh)
{
- char buf[512] = { 0, };
- char *end;
-
- strncpy(buf, id, sizeof(buf) - 1);
- buf[sizeof(buf) - 1] = 0;
- end = strrchr(buf, '.');
- if (end) end++;
- else end = buf;
-
- strcpy(end, "*");
- sh = eina_hash_find(_new_statement_hash, buf);
+ char *tmp = stack_dup_wildcard();
+ sh = eina_hash_find(_new_statement_hash, tmp);
+ free(tmp);
}
if ((!sh) && (!did_wildcard) && (!had_quote))
{
@@ -260,17 +269,9 @@ new_statement(void)
}
else
{
- char buf[512] = { 0, };
- char *end;
-
- strncpy(buf, id, sizeof(buf) - 1);
- buf[sizeof(buf) - 1] = 0;
- end = strrchr(buf, '.');
- if (end) end++;
- else end = buf;
-
- strcpy(end, "*");
- sh = eina_hash_find(_new_statement_hash, buf);
+ char *tmp = stack_dup_wildcard();
+ sh = eina_hash_find(_new_statement_hash, tmp);
+ free(tmp);
if (sh)
{