[glib: 3/13] uri: add a comment about temporary GUri construction




commit d625a29b288e952610cf6c6f2bb73c4c49aa719d
Author: Marc-André Lureau <marcandre lureau redhat com>
Date:   Tue Jul 28 14:25:22 2020 +0400

    uri: add a comment about temporary GUri construction
    
    As pointed out in the discussion of:
    https://gitlab.gnome.org/GNOME/glib/-/issues/2169
    
    Signed-off-by: Marc-André Lureau <marcandre lureau redhat com>

 glib/guri.c | 2 ++
 1 file changed, 2 insertions(+)
---
diff --git a/glib/guri.c b/glib/guri.c
index 06f930dc2..8dfc1cf4c 100644
--- a/glib/guri.c
+++ b/glib/guri.c
@@ -1181,6 +1181,8 @@ g_uri_parse_relative (GUri         *base_uri,
   g_return_val_if_fail (error == NULL || *error == NULL, NULL);
   g_return_val_if_fail (base_uri == NULL || base_uri->scheme != NULL, NULL);
 
+  /* Use GUri struct to construct the return value: there is no guarantee it is
+   * actually correct within the function body. */
   uri = g_atomic_rc_box_new0 (GUri);
   uri->flags = flags;
 


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