summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorshironeko <shironeko@tesaguri.club>2021-09-09 10:32:44 -0400
committershironeko <shironeko@tesaguri.club>2021-09-09 10:32:44 -0400
commitb60cd327fe307300ddbbe13971d99edc09a96079 (patch)
treeccef60f23ac9e0a8aaca2dd0d0b2ee590089fd61
parent9f102c22d4d10b7b002c6f7a6609db034a28ca9e (diff)
downloadglib-b60cd327fe307300ddbbe13971d99edc09a96079.tar.gz
gdesktopappinfo: Return failure rather than blindly call xterm
Instead of calling xterm when it clearly does not exist and causes a silent error, inform the user that the launch failed so they can take the right action.
-rw-r--r--gio/gdesktopappinfo.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/gio/gdesktopappinfo.c b/gio/gdesktopappinfo.c
index 63ef0c045..229e62143 100644
--- a/gio/gdesktopappinfo.c
+++ b/gio/gdesktopappinfo.c
@@ -2613,9 +2613,12 @@ prepend_terminal_to_vector (int *argc,
if (check == NULL)
check = g_find_program_in_path ("dtterm");
if (check == NULL)
+ check = g_find_program_in_path ("xterm");
+ if (check == NULL)
{
- check = g_strdup ("xterm");
- g_debug ("Couldn’t find a terminal: falling back to xterm");
+ g_debug ("Couldn’t find a known terminal");
+ g_free (term_argv);
+ return FALSE;
}
term_argv[0] = check;
term_argv[1] = g_strdup ("-e");