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




commit 3421a703ca4ca726d4aaf850301417bd57d8a05d
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 281a522eb..abcf29b25 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]