From: Enlightenment C. <no...@cv...> - 2008-05-08 14:23:00
|
Enlightenment CVS committal Author : dj2 Project : e17 Module : libs/efreet Dir : e17/libs/efreet/src/lib Modified Files: efreet_ini.c Log Message: - add comments - fix formatting =================================================================== RCS file: /cvs/e/e17/libs/efreet/src/lib/efreet_ini.c,v retrieving revision 1.14 retrieving revision 1.15 diff -u -3 -r1.14 -r1.15 --- efreet_ini.c 8 May 2008 07:11:48 -0000 1.14 +++ efreet_ini.c 8 May 2008 14:22:21 -0000 1.15 @@ -54,6 +54,9 @@ ini = NEW(Efreet_Ini, 1); if (!ini) return NULL; + /* This can validly be NULL at the moment as _parse() will return NULL + * if the input file doesn't exist. Should we change _parse() to create + * the hash and only return NULL on failed parse? */ ini->data = efreet_ini_parse(file); return ini; @@ -62,7 +65,8 @@ /** * @internal * @param file The file to parse - * @return Returns an Ecore_Hash with the contents of @a file, or NULL on failure + * @return Returns an Ecore_Hash with the contents of @a file, or NULL if the + * file fails to parse or if the file doesn't exist * @brief Parses the ini file @a file into an Ecore_Hash */ static Ecore_Hash * @@ -77,8 +81,7 @@ f = fopen(file, "rb"); if (!f) return NULL; - if (fstat(fileno(f), &file_stat) - || file_stat.st_size < 1) + if (fstat(fileno(f), &file_stat) || file_stat.st_size < 1) { fclose(f); return NULL; |