Skip to content

Commit

Permalink
Merge pull request #11 from tri-adam/path-fix
Browse files Browse the repository at this point in the history
fix: handle paths with special characters
  • Loading branch information
CalebQ42 authored Apr 22, 2022
2 parents 6ada4f3 + a908d69 commit 0a2ced9
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions reader_fs.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ func (f FS) Open(name string) (fs.File, error) {
return &File{i: f.i, r: f.r, parent: f.parent, name: f.name}, nil
}
for i := 0; i < len(f.entries); i++ {
if match, _ := path.Match(split[0], f.entries[i].Name); match {
if split[0] == f.entries[i].Name {
if len(split) == 1 {
return f.r.newFileFromDirEntry(f.entries[i], &f)
}
Expand Down Expand Up @@ -193,7 +193,7 @@ func (f FS) ReadDir(name string) ([]fs.DirEntry, error) {
return f.ReadDir(-1)
}
for i := 0; i < len(f.entries); i++ {
if match, _ := path.Match(split[0], f.entries[i].Name); match {
if split[0] == f.entries[i].Name {
if len(split) == 1 {
in, err := f.r.getInodeFromEntry(f.entries[i])
if err != nil {
Expand Down Expand Up @@ -313,7 +313,7 @@ func (f FS) Stat(name string) (fs.FileInfo, error) {
return f.Stat()
}
for i := 0; i < len(f.entries); i++ {
if match, _ := path.Match(split[0], f.entries[i].Name); match {
if split[0] == f.entries[i].Name {
if len(split) == 1 {
in, err := f.r.getInodeFromEntry(f.entries[i])
if err != nil {
Expand Down Expand Up @@ -399,7 +399,7 @@ func (f FS) Sub(dir string) (fs.FS, error) {
return f, nil
}
for i := 0; i < len(f.entries); i++ {
if match, _ := path.Match(split[0], f.entries[i].Name); match {
if split[0] == f.entries[i].Name {
if len(split) == 1 {
in, err := f.r.getInodeFromEntry(f.entries[i])
if err != nil {
Expand Down

0 comments on commit 0a2ced9

Please sign in to comment.