only launch terminology with -d CWD if CWD. CID1352818

This commit is contained in:
Boris Faure 2016-03-12 17:04:06 +01:00
parent 175e474983
commit 4d8c5dd200
1 changed files with 12 additions and 8 deletions

View File

@ -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;
}