Skip to content

Commit

Permalink
🐛 some minor bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
bmatcuk committed Oct 24, 2020
1 parent d8a2e1a commit 72b8db9
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions doublestar.go
Original file line number Diff line number Diff line change
Expand Up @@ -284,11 +284,9 @@ func doMatching(pattern string, nameComponents []string) (matched bool, err erro
return true, nil
}
if patternLen == 0 {
if nameLen == 1 && nameComponents[0] == "" {
return true, nil
} else if nameLen == 0 {
return false, nil
}
return nameLen == 1 && nameComponents[0] == "", nil
} else if nameLen == 0 {
return pattern == "**" || pattern == "*", nil
}

slashIdx := indexRuneWithEscaping(pattern, '/')
Expand Down

0 comments on commit 72b8db9

Please sign in to comment.