aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Persch <chpe@cvs.gnome.org>2004-02-25 19:13:00 +0800
committerChristian Persch <chpe@src.gnome.org>2004-02-25 19:13:00 +0800
commit526fc5eb584f1437c2a81719460b96a9bb463cfa (patch)
tree006653a40473486016a26ebe8c28605f0b66f991
parent9fb6164dd427630f8e72d69113c48a78dd449bc8 (diff)
downloadgsoc2013-epiphany-526fc5eb584f1437c2a81719460b96a9bb463cfa.tar
gsoc2013-epiphany-526fc5eb584f1437c2a81719460b96a9bb463cfa.tar.gz
gsoc2013-epiphany-526fc5eb584f1437c2a81719460b96a9bb463cfa.tar.bz2
gsoc2013-epiphany-526fc5eb584f1437c2a81719460b96a9bb463cfa.tar.lz
gsoc2013-epiphany-526fc5eb584f1437c2a81719460b96a9bb463cfa.tar.xz
gsoc2013-epiphany-526fc5eb584f1437c2a81719460b96a9bb463cfa.tar.zst
gsoc2013-epiphany-526fc5eb584f1437c2a81719460b96a9bb463cfa.zip
Check for NULL before converting filename to UTF-8.
2004-02-25 Christian Persch <chpe@cvs.gnome.org> * src/window-commands.c: (open_response_cb): Check for NULL before converting filename to UTF-8.
-rw-r--r--ChangeLog6
-rw-r--r--src/window-commands.c23
2 files changed, 19 insertions, 10 deletions
diff --git a/ChangeLog b/ChangeLog
index 09899a626..d5c464a6a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2004-02-25 Christian Persch <chpe@cvs.gnome.org>
+
+ * src/window-commands.c: (open_response_cb):
+
+ Check for NULL before converting filename to UTF-8.
+
2004-02-25 Marco Pesenti Gritti <marco@gnome.org>
* embed/ephy-embed-persist.c: (ephy_embed_persist_set_max_size),
diff --git a/src/window-commands.c b/src/window-commands.c
index 5a39dee4e..f1efa3c2d 100644
--- a/src/window-commands.c
+++ b/src/window-commands.c
@@ -362,23 +362,26 @@ window_cmd_file_bookmark_page (GtkAction *action,
}
static void
-open_response_cb (GtkDialog *dialog, gint response, EphyWindow *window)
+open_response_cb (GtkDialog *dialog, int response, EphyWindow *window)
{
if (response == EPHY_RESPONSE_OPEN)
{
char *uri, *converted;
uri = gtk_file_chooser_get_uri (GTK_FILE_CHOOSER (dialog));
- converted = g_filename_to_utf8 (uri, -1, NULL, NULL, NULL);
-
- if (converted != NULL)
+ if (uri != NULL)
{
- ephy_window_load_url(window, converted);
- }
-
- g_free (converted);
- g_free (uri);
- }
+ converted = g_filename_to_utf8 (uri, -1, NULL, NULL, NULL);
+
+ if (converted != NULL)
+ {
+ ephy_window_load_url (window, converted);
+ }
+
+ g_free (converted);
+ g_free (uri);
+ }
+ }
gtk_widget_destroy (GTK_WIDGET (dialog));
}