- if we can't parse the INI file we can't set ini->data so return NULL

instead of an invalid ini file


SVN revision: 34493
This commit is contained in:
Dan Sinclair 2008-05-07 03:04:58 +00:00 committed by Dan Sinclair
parent bc35dd6189
commit 3624e4e923
1 changed files with 3 additions and 3 deletions

View File

@ -55,6 +55,7 @@ efreet_ini_new(const char *file)
if (!ini) return NULL;
ini->data = efreet_ini_parse(file);
if (!ini->data) FREE(ini);
return ini;
}
@ -79,8 +80,7 @@ efreet_ini_parse(const char *file)
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;
@ -274,7 +274,7 @@ efreet_ini_save(Efreet_Ini *ini, const char *file)
EAPI int
efreet_ini_section_set(Efreet_Ini *ini, const char *section)
{
if (!ini || !ini->data || !section) return 0;
if (!ini || !(ini->data) || !section) return 0;
ini->section = ecore_hash_get(ini->data, section);
return (ini->section ? 1 : 0);