From 71d8308f6c41d5d0fa6797a84cf899609fc99fd9 Mon Sep 17 00:00:00 2001 From: raster Date: Wed, 23 Nov 2011 10:42:58 +0000 Subject: [PATCH] lookup duplicate targets and skip new target if already in list. git-svn-id: http://svn.enlightenment.org/svn/e/trunk/edje@65535 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33 --- src/bin/edje_cc_handlers.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/bin/edje_cc_handlers.c b/src/bin/edje_cc_handlers.c index 474348b..67ea8ca 100644 --- a/src/bin/edje_cc_handlers.c +++ b/src/bin/edje_cc_handlers.c @@ -7571,6 +7571,15 @@ st_collections_group_programs_program_target(void) char *copy; name = parse_str(0); + + EINA_LIST_FOREACH(ep->targets, l, etw) + { + if (!strcmp(name, (char*) (etw + 1))) + { + free(name); + return; + } + } et = mem_alloc(SZ(Edje_Program_Target) + strlen(name) + 1); ep->targets = eina_list_append(ep->targets, et); @@ -7599,14 +7608,6 @@ st_collections_group_programs_program_target(void) progname, file_in, line - 1); exit(-1); } - EINA_LIST_FOREACH(ep->targets, l, etw) - if (et != etw && strcmp(name, (char*) (etw + 1)) == 0) - { - ERR("%s: Error. parse error %s:%i. " - "target is targetted twice", - progname, file_in, line - 1); - exit(-1); - } free(name); } } -- 2.7.4