store elm path with trailing path separator

Wed, 23 Oct 2024 18:25:28 +0200

author
Olaf Wintermann <olaf.wintermann@gmail.com>
date
Wed, 23 Oct 2024 18:25:28 +0200
changeset 57
d5a7dbc945ef
parent 56
294d5515583a
child 58
0d25f15e2625

store elm path with trailing path separator

application/window.c file | annotate | diff | comparison | revisions
--- a/application/window.c	Wed Oct 23 17:40:45 2024 +0200
+++ b/application/window.c	Wed Oct 23 18:25:28 2024 +0200
@@ -293,7 +293,7 @@
 
 
     cxmutstr base = cx_strdup(cx_strn(full_path, end));
-    cxmutstr base_path = cx_strdup(cx_strcast(base));
+    cxmutstr base_path = cx_strcat(2, cx_strcast(base), CX_STR("/"));
     cxstring path = cx_strsubs(fpath, end + skip);
 
     cxstring *pathelms;
@@ -331,7 +331,7 @@
         elms[j].name_len = m.length;
 
         size_t elm_path_len = c.ptr + c.length - full_path;
-        cxmutstr elm_path = cx_strdup(cx_strn(full_path, elm_path_len));
+        cxmutstr elm_path = cx_strcat(2, cx_strn(full_path, elm_path_len), CX_STR("/"));
         elms[j].path = elm_path.ptr;
         elms[j].path_len = elm_path.length;
 

mercurial