Bug 528600 – g_dummy_file_get_parent("scheme://example.com/")
authorMatthias Clasen <matthiasc@src.gnome.org>
Tue, 10 Jun 2008 15:27:39 +0000 (15:27 +0000)
committerMatthias Clasen <matthiasc@src.gnome.org>
Tue, 10 Jun 2008 15:27:39 +0000 (15:27 +0000)
        * 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
gio/gdummyfile.c

index 64ec2127f51f7f33881187a5fce43dbb8c261a2e..04b04f84428b6816d6a5dba581d06cf5bd553e0e 100644 (file)
@@ -1,3 +1,10 @@
+2008-06-10  Matthias Clasen <mclasen@redhat.com>
+
+       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  <pborelli@katamail.com>
 
        * gfile.c (g_file_replace_contents): do not leak the output stream.
index 2287674db4d2cb4f52518512d47f77a61b631b51..1fa0aeda95252258793d62f6da8cfe30d303360f 100644 (file)
@@ -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);