summary refs log tree commit diff stats
path: root/src/fe-gtk/menu.c
diff options
context:
space:
mode:
authorArnavion <arnavion@gmail.com>2014-12-08 21:24:59 -0800
committerArnavion <arnavion@gmail.com>2014-12-08 21:24:59 -0800
commitc1831cb19dc1a95bfe96c808aaf5ee42f7401995 (patch)
tree51186833204b4061ead7794b17e8f43d32e03596 /src/fe-gtk/menu.c
parent65da34f19eab5edde0615ccc4a58be1947cfce6e (diff)
Minor tidying up
Diffstat (limited to 'src/fe-gtk/menu.c')
-rw-r--r--src/fe-gtk/menu.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/fe-gtk/menu.c b/src/fe-gtk/menu.c
index 945f6360..63607bed 100644
--- a/src/fe-gtk/menu.c
+++ b/src/fe-gtk/menu.c
@@ -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);