on initial config save - if nothing has been selected default to homedir
this avoids a fun segv with a NULL path ptr
This commit is contained in:
parent
7714e3756b
commit
c9fbad5399
|
@ -29,6 +29,11 @@ _config_save_cb(void *data, Evas_Object *obj EINA_UNUSED,
|
||||||
else
|
else
|
||||||
path = elm_object_text_get(ephoto->config->open_dir_custom);
|
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"))
|
if (ecore_file_is_dir(path) || !strcmp(path, "Last"))
|
||||||
eina_stringshare_replace(&ephoto->config->open, path);
|
eina_stringshare_replace(&ephoto->config->open, path);
|
||||||
if (strcmp(path, ephoto->config->directory) && strcmp(path, "Last") &&
|
if (strcmp(path, ephoto->config->directory) && strcmp(path, "Last") &&
|
||||||
|
|
Loading…
Reference in New Issue