[glib/glib-2-70: 1/3] gfileutils: Add a comment in g_canonicalize_filename()




commit 96bccb89df54a8798fc2de79e4837655e06950db
Author: Philip Withnall <pwithnall endlessos org>
Date:   Thu Dec 2 11:32:25 2021 +0000

    gfileutils: Add a comment in g_canonicalize_filename()
    
    Clarify the code a little. This introduces no functional changes.
    
    Signed-off-by: Philip Withnall <pwithnall endlessos org>

 glib/gfileutils.c | 2 ++
 1 file changed, 2 insertions(+)
---
diff --git a/glib/gfileutils.c b/glib/gfileutils.c
index 5a161cb75..f2045ead9 100644
--- a/glib/gfileutils.c
+++ b/glib/gfileutils.c
@@ -2775,6 +2775,8 @@ g_canonicalize_filename (const gchar *filename,
        output--)
     *output = G_DIR_SEPARATOR;
 
+  /* 1 to re-increment after the final decrement above (so that output >= canon),
+   * and 1 to skip the first `/` */
   output += 2;
 
   /* POSIX allows double slashes at the start to mean something special


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