[glib/wip/oholy/peek-path-fixes] gfile: Fix g_file_peek_path() for remote locations



commit 9329c2915d893fc8bd2736214f715831c3ceb822
Author: Ondrej Holy <oholy redhat com>
Date:   Wed Jan 29 14:51:38 2020 +0100

    gfile: Fix g_file_peek_path() for remote locations
    
    g_file_peek_path() doesn't work for GVfs locations on the first attempt,
    because the compare-and-swap loop is broken before the return value is
    set.

 gio/gfile.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/gio/gfile.c b/gio/gfile.c
index 593c5d5aa..c75779db3 100644
--- a/gio/gfile.c
+++ b/gio/gfile.c
@@ -568,7 +568,7 @@ file_peek_path_generic (GFile *file)
       if (g_object_replace_qdata ((GObject *) file, _file_path_quark,
                                   NULL, (gpointer) new_path,
                                   (GDestroyNotify) g_free, NULL))
-        break;
+        return new_path;
       else
         g_free (new_path);
     }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]