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

Note: i've put a bug in bugzilla about it. Maybe it would be usefull that 
you look at it to give your opinion about a patch before I commit it.

-------------------------------------------------------------------------
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

Reply via email to