From c65bade448c606783c149ce2fb5ccec7461b39ee Mon Sep 17 00:00:00 2001 From: Tony Houghton Date: Thu, 4 Oct 2007 22:07:14 +0100 Subject: [PATCH] Fixed check for execs without path and taking arguments. --- src/xdgautostart.c | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/src/xdgautostart.c b/src/xdgautostart.c index 4506bfa..65556e2 100644 --- a/src/xdgautostart.c +++ b/src/xdgautostart.c @@ -168,9 +168,13 @@ gboolean desktop_entry_get_show_in_environ(const DesktopEntry *de, gboolean desktop_entry_can_start_in_rox(const DesktopEntry *de) { if (!desktop_entry_get_show_in_rox(de)) + { return FALSE; + } if (!de->exec) + { return FALSE; + } if (de->try_exec) { if (!g_file_test(de->try_exec, G_FILE_TEST_EXISTS)) @@ -182,9 +186,20 @@ gboolean desktop_entry_can_start_in_rox(const DesktopEntry *de) } else { - char *ef = g_find_program_in_path(de->exec); - gboolean result = ef != NULL; - + char *exec = g_strdup(de->exec); + char *spc = strchr(exec, ' '); + char *ef; + gboolean result; + + if (spc) + *spc = 0; + spc = strchr(exec, '\t'); + if (spc) + *spc = 0; + ef = g_find_program_in_path(exec); + result = ef != NULL; + + g_free(exec); g_free(ef); return result; } -- 2.11.4.GIT