Skip to content

Commit

Permalink
Added filepath.ToSlash after filepath.Clean (#13)
Browse files Browse the repository at this point in the history
filepath.Clean replaces forward slashes with backslashes on windows
Fixes #12

Co-authored-by: Sebastian Schumb <[email protected]>
  • Loading branch information
LongHairedHacker and Sebastian Schumb authored Jun 9, 2024
1 parent 6a52119 commit 13e5911
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ext4/fs.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,8 @@ func (ext4 *FileSystem) readDirEntry(name string) ([]fs.DirEntry, error) {
}

var currentIno int64
dirs := strings.Split(strings.Trim(filepath.Clean(name), "/"), "/")
cleanedPath := filepath.ToSlash(filepath.Clean(name))
dirs := strings.Split(strings.Trim(cleanedPath, "/"), "/")
if len(dirs) == 1 && dirs[0] == "." || dirs[0] == "" {
var dirEntries []fs.DirEntry
for _, fileInfo := range fileInfos {
Expand Down

0 comments on commit 13e5911

Please sign in to comment.