From 946b78006b14d58c3bdd32454f7ac6227950c4c3 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Tue, 10 Jun 2008 15:27:39 +0000 Subject: [PATCH] =?UTF-8?q?=20=20=20=20=20=20=20=20Bug=20528600=20?= =?UTF-8?q?=E2=80=93=20g=5Fdummy=5Ffile=5Fget=5Fparent("scheme://example.c?= =?UTF-8?q?om/")?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * gdummyfile.c (g_dummy_file_get_parent): Return NULL if there is no parent. (Owen Taylor, patch by Christian Persch) svn path=/trunk/; revision=6987 --- gio/ChangeLog | 7 +++++++ gio/gdummyfile.c | 3 ++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/gio/ChangeLog b/gio/ChangeLog index 64ec2127f..04b04f844 100644 --- a/gio/ChangeLog +++ b/gio/ChangeLog @@ -1,3 +1,10 @@ +2008-06-10 Matthias Clasen + + Bug 528600 – g_dummy_file_get_parent("scheme://example.com/") + + * gdummyfile.c (g_dummy_file_get_parent): Return NULL if there + is no parent. (Owen Taylor, patch by Christian Persch) + 2008-06-10 Paolo Borelli * gfile.c (g_file_replace_contents): do not leak the output stream. diff --git a/gio/gdummyfile.c b/gio/gdummyfile.c index 2287674db..1fa0aeda9 100644 --- a/gio/gdummyfile.c +++ b/gio/gdummyfile.c @@ -172,7 +172,8 @@ g_dummy_file_get_parent (GFile *file) char *uri; GDecodedUri new_decoded_uri; - if (dummy->decoded_uri == NULL) + if (dummy->decoded_uri == NULL || + g_strcmp0 (dummy->decoded_uri->path, "/") == 0) return NULL; dirname = g_path_get_dirname (dummy->decoded_uri->path);