diff options
-rw-r--r-- | sb.c | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -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); } |