From 4d8c5dd20026f9bcd66e0fc9a7bf9d1d05754455 Mon Sep 17 00:00:00 2001 From: Boris Faure Date: Sat, 12 Mar 2016 17:04:06 +0100 Subject: [PATCH] only launch terminology with -d CWD if CWD. CID1352818 --- src/bin/keyin.c | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/src/bin/keyin.c b/src/bin/keyin.c index 8c6d62f4..817e2035 100644 --- a/src/bin/keyin.c +++ b/src/bin/keyin.c @@ -375,14 +375,18 @@ cb_term_new(Evas_Object *termio_obj) eina_file_path_join(path, sizeof(path), elm_app_bin_dir_get(), "terminology"); - termio_cwd_get(termio_obj, cwd, sizeof(cwd)); - - length = (strlen(path) + strlen(cwd) + strlen(template) - 3); - cmd = malloc(sizeof(char) * length); - snprintf(cmd, length, template, path, cwd); - - ecore_exe_run(cmd, NULL); - free(cmd); + if (termio_cwd_get(termio_obj, cwd, sizeof(cwd))) + { + length = (strlen(path) + strlen(cwd) + strlen(template) - 3); + cmd = malloc(sizeof(char) * length); + snprintf(cmd, length, template, path, cwd); + ecore_exe_run(cmd, NULL); + free(cmd); + } + else + { + ecore_exe_run(path, NULL); + } return EINA_TRUE; }