Minor tidying up

This commit is contained in:
Arnavion
2014-12-08 21:24:59 -08:00
parent 65da34f19e
commit c1831cb19d
9 changed files with 21 additions and 35 deletions

View File

@@ -403,12 +403,11 @@ toggle_cb (GtkWidget *item, char *pref_name)
static int
is_in_path (char *cmd)
{
char *prog = g_strdup (cmd + 1); /* 1st char is "!" */
char *path, *orig;
char *orig = g_strdup (cmd + 1); /* 1st char is "!" */
char *prog = orig;
char **argv;
int argc;
orig = prog; /* save for free()ing */
/* special-case these default entries. */
/* 123456789012345678 */
if (strncmp (prog, "gnome-terminal -x ", 18) == 0)
@@ -417,15 +416,14 @@ is_in_path (char *cmd)
if (g_shell_parse_argv (prog, &argc, &argv, NULL))
{
path = g_find_program_in_path (argv[0]);
char *path = g_find_program_in_path (argv[0]);
g_strfreev (argv);
if (path)
{
g_free (path);
g_free (orig);
g_strfreev (argv);
return 1;
}
g_strfreev (argv);
}
g_free (orig);