Vincent Torri wrote: > > On Fri, 14 Sep 2007, Enlightenment CVS wrote: > >> Enlightenment CVS committal >> >> Author : englebass >> Project : e17 >> Module : libs/efreet >> >> Dir : e17/libs/efreet/src/lib >> >> >> Modified Files: >> efreet_ini.c >> >> >> Log Message: >> Revert erronous changes. >> >> =================================================================== >> RCS file: /cvs/e/e17/libs/efreet/src/lib/efreet_ini.c,v >> retrieving revision 1.6 >> retrieving revision 1.7 >> diff -u -3 -r1.6 -r1.7 >> --- efreet_ini.c 6 Sep 2007 16:15:09 -0000 1.6 >> +++ efreet_ini.c 14 Sep 2007 22:22:29 -0000 1.7 >> @@ -56,11 +56,6 @@ >> if (!ini) return NULL; >> >> ini->data = efreet_ini_parse(file); >> - if (!ini->data) >> - { >> - FREE(ini); >> - return NULL; >> - } >> >> return ini; >> } >> @@ -98,15 +93,13 @@ >> buf = read_buf = static_buf; >> read_len = static_buf_len; >> >> - data = ecore_hash_new(ecore_str_hash, ecore_str_compare); >> - if (!data) return NULL; >> + f = fopen(file, "rb"); >> + if (!f) return NULL; >> >> + data = ecore_hash_new(ecore_str_hash, ecore_str_compare); >> ecore_hash_free_key_cb_set(data, ECORE_FREE_CB(ecore_string_release)); >> ecore_hash_free_value_cb_set(data, ECORE_FREE_CB(ecore_hash_destroy)); >> >> - f = fopen(file, "rb"); >> - if (!f) return data; >> - >> /* if a line is longer than the buffer size, this \n will get >> overwritten. */ >> read_buf[read_len - 2] = '\n'; >> while (fgets(read_buf, read_len, f) != NULL) >> @@ -273,7 +266,7 @@ >> efreet_ini_save(Efreet_Ini *ini, const char *file) >> { >> FILE *f; >> - if (!ini) return 0; >> + if (!ini || !ini->data) return 0; >> >> f = fopen(file, "wb"); >> if (!f) return 0; >> @@ -293,7 +286,7 @@ >> int >> efreet_ini_section_set(Efreet_Ini *ini, const char *section) >> { >> - if (!ini || !section) return 0; >> + if (!ini || !ini->data || !section) return 0; >> >> ini->section = ecore_hash_get(ini->data, section); >> return (ini->section ? 1 : 0); >> > > Seb, > > can you please explain why these changes were wrong ? > > thank you > > Vincent
Sure. Have you seen all the places in the code where it checks for ini->data == NULL to see whether a ini file exists? if ini->data is always created, we have a problem. Please don't change the behaviour of the code before consulting the creator of the code. Sebastian ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2005. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ enlightenment-devel mailing list enlightenment-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-devel