aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBoris Faure <billiob@gmail.com>2016-03-12 17:04:06 +0100
committerBoris Faure <billiob@gmail.com>2016-03-12 17:04:06 +0100
commit4d8c5dd20026f9bcd66e0fc9a7bf9d1d05754455 (patch)
treed13df72925d678a9ad5ef2cbf182fe6697c4f9c2
parentadd safe guards around term_set_title (diff)
downloadterminology-4d8c5dd20026f9bcd66e0fc9a7bf9d1d05754455.tar.gz
only launch terminology with -d CWD if CWD. CID1352818
-rw-r--r--src/bin/keyin.c20
1 files changed, 12 insertions, 8 deletions
diff --git a/src/bin/keyin.c b/src/bin/keyin.c
index 8c6d62f..817e203 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;
}