Ignore empty values, don't write them either.

SVN revision: 25888
This commit is contained in:
David Walter Seikel 2006-09-16 15:14:18 +00:00
parent 5e59f3af40
commit 7a0519ac2a
1 changed files with 9 additions and 2 deletions

View File

@ -133,7 +133,8 @@ ecore_desktop_ini_get(const char *file)
/* FIXME: should strip space at end, then unescape value. */
tv = ecore_hash_remove(current, key);
if (tv) free(tv);
ecore_hash_set(current, strdup(key), strdup(value));
if (value[0] != '\0')
ecore_hash_set(current, strdup(key), strdup(value));
#ifdef DEBUG
fprintf(stdout, " %s=%s\n", key, value);
#endif
@ -577,7 +578,13 @@ ecore_desktop_save(Ecore_Desktop * desktop)
fprintf(f, "[Desktop Entry]\n");
ecore_list_goto_first(list);
while ((key = (char *) ecore_list_next(list)))
fprintf(f, "%s=%s\n", key, (char *) ecore_hash_get(desktop->group, key));
{
char *value;
value = (char *) ecore_hash_get(desktop->group, key);
if ((value) && (value[0] != '\0'))
fprintf(f, "%s=%s\n", key, value);
}
fclose(f);
}
}