diff options
| author | mutantturkey <crazycal00@gmail.com> | 2011-05-04 22:33:21 -0400 | 
|---|---|---|
| committer | mutantturkey <crazycal00@gmail.com> | 2011-05-04 22:33:21 -0400 | 
| commit | 4650541d1fe727f8ade49202cdb1b3474e75646d (patch) | |
| tree | 5d235fdca6dbfe62153e18f5d055e6cca759dc48 | |
| parent | 91ea0edbd74002aa4ac22873300cea794ea4ece6 (diff) | |
fixed compiler warning by adding NULL and actually fixed history problem
| -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);  } | 
