aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2015-04-13 09:38:35 +0900
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2015-04-13 09:45:29 +0900
commite05eb13f702c3addb4ac6261ff5a84f2cf4fd065 (patch)
treea54633d9660e5e095937e035caa668f1e4f79892
parentefreetd - cache generators - dont unlink then rename - fix (diff)
downloadefl-e05eb13f702c3addb4ac6261ff5a84f2cf4fd065.tar.gz
efreetd - fix loading of extra_icons.dirs and icon.exts to not lose char
efreetd was losing the last char on every line of extra_icon.dirs and icon.exts thus resulting in gradual degredation of these files as more and more changes happen to have things like: .jpeg .jpe .jp .j . etc. for extension or dirs like /home/raster/.e/e/icons /home/raster/.e/e/icon /home/raster/.e/e/ico ... /home/ras /home/ra /home/r ... /ho /h / .. you get the idea. before long the list of extra icon dirs (and extensions) was massigve and caued all sorts of filesystem rummaging. this fixes that to no longer degrade these files. this also changes their names to force new files to be used instead of the broken old ones.
-rw-r--r--src/bin/efreet/efreetd_cache.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/bin/efreet/efreetd_cache.c b/src/bin/efreet/efreetd_cache.c
index 21c21b69a8..76be7bff1a 100644
--- a/src/bin/efreet/efreetd_cache.c
+++ b/src/bin/efreet/efreetd_cache.c
@@ -677,8 +677,8 @@ fill_list(const char *file, Eina_List **l)
{
if (line->end > line->start)
{
- const char *end = line->end - 1;
- *l = eina_list_append(*l, eina_stringshare_add_length(line->start, end - line->start));
+ const char *s = eina_stringshare_add_length(line->start, line->end - line->start);
+ if (s) *l = eina_list_append(*l, s);
}
}
eina_iterator_free(it);
@@ -689,9 +689,9 @@ error:
static void
read_lists(void)
{
- fill_list("extra_desktop.dirs", &desktop_extra_dirs);
- fill_list("extra_icon.dirs", &icon_extra_dirs);
- fill_list("icon.exts", &icon_exts);
+ fill_list("extra_desktops.dirs", &desktop_extra_dirs);
+ fill_list("extra_icons.dirs", &icon_extra_dirs);
+ fill_list("icons.exts", &icon_exts);
}
static void
@@ -777,7 +777,7 @@ cache_desktop_dir_add(const char *dir)
{
/* Not a registered path */
desktop_extra_dirs = eina_list_append(desktop_extra_dirs, eina_stringshare_add(san));
- save_list("extra_desktop.dirs", desktop_extra_dirs);
+ save_list("extra_desktops.dirs", desktop_extra_dirs);
cache_desktop_update();
}
free(san);
@@ -794,7 +794,7 @@ cache_icon_dir_add(const char *dir)
{
if (!strcmp(san, "/")) goto out;
icon_extra_dirs = eina_list_append(icon_extra_dirs, eina_stringshare_add(san));
- save_list("extra_icon.dirs", icon_extra_dirs);
+ save_list("extra_icons.dirs", icon_extra_dirs);
cache_icon_update(EINA_TRUE);
}
out:
@@ -807,7 +807,7 @@ cache_icon_ext_add(const char *ext)
if (!eina_list_search_unsorted_list(icon_exts, EINA_COMPARE_CB(strcmp), ext))
{
icon_exts = eina_list_append(icon_exts, eina_stringshare_add(ext));
- save_list("icon.exts", icon_exts);
+ save_list("icons.exts", icon_exts);
cache_icon_update(EINA_TRUE);
}
}