diff options
author | Daniel Zaoui <daniel.zaoui@yahoo.com> | 2013-12-03 21:06:07 +0200 |
---|---|---|
committer | Daniel Zaoui <daniel.zaoui@yahoo.com> | 2013-12-05 08:25:09 +0200 |
commit | 1f37b472374b13edd3c00653b567e60632e5c733 (patch) | |
tree | e1531be6b1774d09266915e07275d7ab17f83804 | |
parent | 7334283e443a69dda8a3ce8d1b7f999ad353f513 (diff) | |
download | efl-devs/jackdanielz/edje_pick.tar.gz |
Fix output creation when no groupsdevs/jackdanielz/edje_pick
-rw-r--r-- | src/lib/edje/edje_pick_core.c | 34 |
1 files changed, 11 insertions, 23 deletions
diff --git a/src/lib/edje/edje_pick_core.c b/src/lib/edje/edje_pick_core.c index c57106587e..08ee1148cd 100644 --- a/src/lib/edje/edje_pick_core.c +++ b/src/lib/edje/edje_pick_core.c @@ -433,16 +433,16 @@ _edje_pick_external_dir_update(Edje_File *o, Edje_File *edf) static void _session_output_prepare(Edje_Pick_Session *session, Edje_Pick_File_Info *in_info) { - Edje_File *edf = in_info->edf; + Edje_File *edf = (in_info?in_info->edf:NULL); Edje_File *o = session->output_info.edf; /* Allocate and prepare header memory buffer */ if (!o) { o = calloc(1, sizeof(Edje_File)); o->compiler = eina_stringshare_add("edje_cc"); - o->version = edf->version; - o->minor = edf->minor; - o->feature_ver = edf->feature_ver; + o->version = (edf?edf->version:0); + o->minor = (edf?edf->minor:0); + o->feature_ver = (edf?edf->feature_ver:0); o->collection = eina_hash_string_small_new(NULL); /* Open output file */ @@ -473,19 +473,7 @@ _session_output_prepare(Edje_Pick_Session *session, Edje_Pick_File_Info *in_info } } - _edje_pick_external_dir_update(o, edf); -} - -static void -_session_output_finish(Edje_Pick_Session *session) -{ - Edje_File *o = session->output_info.edf; - /* Allocate and prepare header memory buffer */ - if (o) - { - eet_close(session->output_info.edf->ef); - SAFE_FREE(session->output_info.edf, free); - } + if (edf) _edje_pick_external_dir_update(o, edf); } static Edje_Pick_Status @@ -1280,6 +1268,7 @@ edje_pick_process(Edje_Pick_Session *session) int bytes; _session_print(session); + _session_output_prepare(session, NULL); /* START - Main loop scanning input files */ EINA_LIST_FOREACH(session->input_files_infos, itr, info) @@ -1354,11 +1343,6 @@ edje_pick_process(Edje_Pick_Session *session) } /* END - Main loop scanning input files */ - if (session->next_group_id == 0) - { /* No groups were fetch from input files - ABORT */ - return EDJE_PICK_NO_GROUP; - } - /* Write rest of output */ EINA_LIST_FOREACH(session->input_files_infos, itr, info) @@ -1459,7 +1443,11 @@ edje_pick_process(Edje_Pick_Session *session) if (output_filename) printf("Wrote <%s> output file.\n", output_filename); - _session_output_finish(session); + if (session->output_info.edf) + { + eet_close(session->output_info.edf->ef); + SAFE_FREE(session->output_info.edf, free); + } return EDJE_PICK_NO_ERROR; } |