summaryrefslogtreecommitdiff
path: root/lib/sqfs/read_tree.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/sqfs/read_tree.c')
-rw-r--r--lib/sqfs/read_tree.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/sqfs/read_tree.c b/lib/sqfs/read_tree.c
index f9c2a4e..eaf7c16 100644
--- a/lib/sqfs/read_tree.c
+++ b/lib/sqfs/read_tree.c
@@ -225,8 +225,14 @@ int sqfs_dir_reader_get_full_hierarchy(sqfs_dir_reader_t *rd,
goto fail;
ptr = strchr(path, '/');
- if (ptr == NULL)
- ptr = strchrnul(path, '\\');
+ if (ptr == NULL) {
+ ptr = strchr(path, '\\');
+
+ if (ptr == NULL) {
+ for (ptr = path; *ptr != '\0'; ++ptr)
+ ;
+ }
+ }
for (;;) {
ret = sqfs_dir_reader_read(rd, &ent);