From 4650541d1fe727f8ade49202cdb1b3474e75646d Mon Sep 17 00:00:00 2001 From: mutantturkey Date: Wed, 4 May 2011 22:33:21 -0400 Subject: fixed compiler warning by adding NULL and actually fixed history problem --- sb.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/sb.c b/sb.c index 7b37315..f0155a7 100644 --- a/sb.c +++ b/sb.c @@ -170,7 +170,7 @@ fclose(history); /* an alternative to the regular tab command, combines tabbing and history command into one */ static void tab_and_go() { gchar *returned; -g_spawn_command_line_sync(g_strconcat("sh -c 'sort ", g_build_filename(g_get_home_dir(), ".sb_history"), " | dmenu -l 15 -xs -c'", NULL), &returned, NULL, NULL, NULL); +g_spawn_command_line_sync(g_strconcat("sh -c 'sort ", g_build_filename(g_get_home_dir(), ".sb_history", NULL), " | dmenu -l 15 -xs -c'", NULL), &returned, NULL, NULL, NULL); if(strcmp(returned, "") == 0) { focus_view(); } else { tab_new(FALSE); load_uri(returned); g_free(returned); } @@ -323,10 +323,12 @@ gtk_widget_grab_focus(w.bar); /* call the history command. should we do it ASYNC?*/ static void history_command() { -gchar *returned; -g_spawn_command_line_sync(g_strconcat("sh -c 'sort ~", g_build_filename(g_get_home_dir(), DEFAULT_HISTORY_FILE), " | dmenu -l 15 -xs -c'", NULL), &returned, NULL, NULL, NULL); +gchar *returned, *file; +file = g_build_filename(g_get_home_dir(), DEFAULT_HISTORY_FILE, NULL); +g_spawn_command_line_sync(g_strconcat("sh -c 'sort ", file, " | dmenu -l 15 -xs -c'", NULL), &returned, NULL, NULL, NULL); if(strcmp(returned, "") == 0) { focus_view(); } else { load_uri(returned); } g_free(returned); +g_free(file); } -- cgit v1.2.3