From b625529c8bbd1ee61a4544397edb72e6ec45d3f9 Mon Sep 17 00:00:00 2001 From: Nick Treleaven Date: Fri, 21 Jul 2006 19:35:33 +0000 Subject: [PATCH] Prevent using Find in files for unnamed files git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@599 ea778897-0a13-0410-b9d1-a72fbfd435f5 --- ChangeLog | 5 +++++ src/dialogs.c | 10 ++++++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 230630f9..753180f5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2006-07-21 Nick Treleaven + + * src/dialogs.c: Prevent using Find in files for unnamed files. + + 2006-07-21 Enrico Tröger * src/geany.h, src/main.c, src/callbacks.c: diff --git a/src/dialogs.c b/src/dialogs.c index b09c320f..186c8584 100644 --- a/src/dialogs.c +++ b/src/dialogs.c @@ -1032,6 +1032,13 @@ void dialogs_show_find_in_files(void) if (idx == -1 || ! doc_list[idx].is_valid) return; + cur_dir = utils_get_current_file_dir(); + if (cur_dir == NULL) + { + utils_set_statusbar(_("Invalid directory for find in files."), FALSE); + return; + } + if (app->find_in_files_dialog == NULL) { GtkWidget *label; @@ -1086,10 +1093,9 @@ void dialogs_show_find_in_files(void) g_free(sel); gtk_widget_grab_focus(entry); - cur_dir = utils_get_current_file_dir(); dirtext = g_strdup_printf(_("Current directory: %s"), cur_dir); - g_free(cur_dir); gtk_label_set_text(GTK_LABEL(dirlabel), dirtext); + g_free(cur_dir); g_free(dirtext); gtk_widget_show(app->find_in_files_dialog);