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



commit 197ea9fe43365cecc20cbe9ffbc016185d74e618
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 597db9e1a..4e6e39827 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]