From 8f5f8702412a98fd8f70a9342f82414127703806 Mon Sep 17 00:00:00 2001
From: Scott Moser <smoser@brickies.net>
Date: Wed, 13 Jan 2021 21:31:00 -0500
Subject: Fix more normalization of slashes in filenames.

It looks like the last commit missed a couple more occurences
where '\' was treated incorrectly.

Fixes were still needed in sqfs_dir_reader_find_by_path and
sqfs_dir_reader_get_full_hierarchy.

This path is used in extras/browse.c.
---
 lib/sqfs/dir_reader.c | 5 ++---
 lib/sqfs/read_tree.c  | 5 ++---
 2 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/lib/sqfs/dir_reader.c b/lib/sqfs/dir_reader.c
index 49d1188..65962d8 100644
--- a/lib/sqfs/dir_reader.c
+++ b/lib/sqfs/dir_reader.c
@@ -277,8 +277,8 @@ int sqfs_dir_reader_find_by_path(sqfs_dir_reader_t *rd,
 		return ret;
 
 	while (*path != '\0') {
-		if (*path == '/' || *path == '\\') {
-			while (*path == '/' || *path == '\\')
+		if (*path == '/') {
+			while (*path == '/')
 				++path;
 			continue;
 		}
@@ -290,7 +290,6 @@ int sqfs_dir_reader_find_by_path(sqfs_dir_reader_t *rd,
 
 		ptr = strchr(path, '/');
 		if (ptr == NULL) {
-			ptr = strchr(path, '\\');
 
 			if (ptr == NULL) {
 				for (ptr = path; *ptr != '\0'; ++ptr)
diff --git a/lib/sqfs/read_tree.c b/lib/sqfs/read_tree.c
index b668ef4..56b4f0c 100644
--- a/lib/sqfs/read_tree.c
+++ b/lib/sqfs/read_tree.c
@@ -214,8 +214,8 @@ int sqfs_dir_reader_get_full_hierarchy(sqfs_dir_reader_t *rd,
 	inode = NULL;
 
 	while (path != NULL && *path != '\0') {
-		if (*path == '/' || *path == '\\') {
-			while (*path == '/' || *path == '\\')
+		if (*path == '/') {
+			while (*path == '/')
 				++path;
 			continue;
 		}
@@ -226,7 +226,6 @@ int sqfs_dir_reader_get_full_hierarchy(sqfs_dir_reader_t *rd,
 
 		ptr = strchr(path, '/');
 		if (ptr == NULL) {
-			ptr = strchr(path, '\\');
 
 			if (ptr == NULL) {
 				for (ptr = path; *ptr != '\0'; ++ptr)
-- 
cgit v1.2.3