From f5e062c6762b31889c6ac0153182cf41f395cd93 Mon Sep 17 00:00:00 2001 From: Gustavo Sverzut Barbieri Date: Tue, 12 Oct 2010 23:46:36 +0000 Subject: [PATCH] handle no parameter without previous directory. SVN revision: 53321 --- src/bin/ephoto_main.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src/bin/ephoto_main.c b/src/bin/ephoto_main.c index 49595a5..8fbf3d1 100644 --- a/src/bin/ephoto_main.c +++ b/src/bin/ephoto_main.c @@ -205,11 +205,19 @@ ephoto_window_add(const char *path) if ((!path) || (!ecore_file_exists(path))) { - ephoto_thumb_browser_directory_set - (ephoto->thumb_browser, ephoto->config->directory); - _ephoto_thumb_browser_show(ephoto, NULL); + char buf[PATH_MAX]; + path = ephoto->config->directory; + if ((path) && (!ecore_file_exists(path))) path = NULL; + if (!path) + { + if (getcwd(buf, sizeof(buf))) + path = buf; + else + path = getenv("HOME"); + } } - else if (ecore_file_is_dir(path)) + + if (ecore_file_is_dir(path)) { ephoto_thumb_browser_directory_set(ephoto->thumb_browser, path); _ephoto_thumb_browser_show(ephoto, NULL);