aboutsummaryrefslogtreecommitdiff
path: root/lib/fstree/mknode.c
diff options
context:
space:
mode:
authorDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2021-12-05 10:17:03 +0100
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2022-03-30 22:31:30 +0200
commita0e9956f931e28eeb430bd2459668fd96a69c676 (patch)
treeb17b9c6a6b282598affa2cf695ee18a2ebaa0a17 /lib/fstree/mknode.c
parentbb526954f24b2be5c574810a72395461cadd2d0c (diff)
Fix: Directory insertion order on Windows
The fstree sorting code got removed recently, in favour of inserting at the correct position. The Windows directory scanning code still used it's own list insertion code instead of mknode (so it could allocate and translate the directory entry name in-place), which broke the sorting order. This issue is fixed in this commit. Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'lib/fstree/mknode.c')
-rw-r--r--lib/fstree/mknode.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/fstree/mknode.c b/lib/fstree/mknode.c
index 75fa46a..7d6e315 100644
--- a/lib/fstree/mknode.c
+++ b/lib/fstree/mknode.c
@@ -6,13 +6,13 @@
*/
#include "config.h"
-#include "fstree.h"
+#include "internal.h"
#include <string.h>
#include <stdlib.h>
#include <errno.h>
-static void insert_sorted(tree_node_t *root, tree_node_t *n)
+void fstree_insert_sorted(tree_node_t *root, tree_node_t *n)
{
tree_node_t *it = root->data.dir.children, *prev = NULL;
@@ -88,7 +88,7 @@ tree_node_t *fstree_mknode(tree_node_t *parent, const char *name,
}
if (parent != NULL) {
- insert_sorted(parent, n);
+ fstree_insert_sorted(parent, n);
if (parent->link_count == 0x0FFFF) {
free(n);