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



commit 18ddb90e5498fb8763b4fc588164619b4a996966
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 | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
---
diff --git a/gio/gfile.c b/gio/gfile.c
index 593c5d5aa..4bb6bdcb2 100644
--- a/gio/gfile.c
+++ b/gio/gfile.c
@@ -568,7 +568,10 @@ 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;
+        {
+          path = new_path;
+          break;
+        }
       else
         g_free (new_path);
     }


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