diff options
author | Jeeyong Um <conr2d@gmail.com> | 2017-11-10 12:59:55 +0900 |
---|---|---|
committer | Jeeyong Um <conr2d@gmail.com> | 2017-11-10 12:59:55 +0900 |
commit | 7c0f1fdd34186220ca01d6b52b02b94cf6db9962 (patch) | |
tree | 700bcbe2a732603f137e4cedd5b53ce6b3ccedeb | |
parent | 247d25aa99b6dd461ce82f61fa8345f86c157b0f (diff) | |
download | efl-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.c | 45 |
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) { |