diff -r 1dbdb6cb8eec -r 4ee7a4b648ad src/prefs.c --- a/src/prefs.c Tue Oct 09 23:44:24 2001 +0000 +++ b/src/prefs.c Wed Oct 10 00:26:26 2001 +0000 @@ -1356,6 +1356,7 @@ static GtkWidget *sndent[NUM_SOUNDS]; static GtkWidget *sndcmd = NULL; +static char *last_sound_dir = NULL; void close_sounddialog(GtkWidget *w, GtkWidget *w2) { @@ -1396,6 +1397,10 @@ /* Close the window! It's getting cold in here! */ close_sounddialog(NULL, sounddialog); + + if (last_sound_dir) + g_free(last_sound_dir); + last_sound_dir = g_dirname(sound_file[snd]); } static void reset_sound(GtkWidget *button, int snd) @@ -1409,7 +1414,6 @@ static void sel_sound(GtkWidget *button, int snd) { - char *buf = g_malloc(BUF_LEN); if (!sounddialog) { @@ -1417,7 +1421,7 @@ gtk_file_selection_hide_fileop_buttons(GTK_FILE_SELECTION(sounddialog)); - g_snprintf(buf, BUF_LEN - 1, "%s/", getenv("HOME")); + g_snprintf(buf, BUF_LEN - 1, "%s/", last_sound_dir ? last_sound_dir : g_get_home_dir()); gtk_file_selection_set_filename(GTK_FILE_SELECTION(sounddialog), buf);