aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2018-02-01 19:59:34 +0900
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2018-02-01 19:59:34 +0900
commitc9fbad53996848554937443ddd688d1e5540908e (patch)
tree57fd218868a67d3bfca7b27bd26f0141c83f8722
parentephoto_config: fix segv on start (diff)
downloadephoto-c9fbad53996848554937443ddd688d1e5540908e.tar.gz
on initial config save - if nothing has been selected default to homedir
this avoids a fun segv with a NULL path ptr
-rw-r--r--src/bin/ephoto_config.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/bin/ephoto_config.c b/src/bin/ephoto_config.c
index f3b871d..4279c32 100644
--- a/src/bin/ephoto_config.c
+++ b/src/bin/ephoto_config.c
@@ -29,6 +29,11 @@ _config_save_cb(void *data, Evas_Object *obj EINA_UNUSED,
else
path = elm_object_text_get(ephoto->config->open_dir_custom);
+ if (!path)
+ path = eina_environment_home_get();
+ if (!path)
+ path = "/";
+
if (ecore_file_is_dir(path) || !strcmp(path, "Last"))
eina_stringshare_replace(&ephoto->config->open, path);
if (strcmp(path, ephoto->config->directory) && strcmp(path, "Last") &&