match on prefix star, fixes #76w

This commit is contained in:
Josh Baker 2016-11-02 09:15:11 -07:00
parent fbff0f4eef
commit d6f83adb30
1 changed files with 3 additions and 1 deletions

View File

@ -1,5 +1,7 @@
package glob package glob
import "strings"
type Glob struct { type Glob struct {
Pattern string Pattern string
Desc bool Desc bool
@ -24,7 +26,7 @@ func IsGlob(pattern string) bool {
func Parse(pattern string, desc bool) *Glob { func Parse(pattern string, desc bool) *Glob {
g := &Glob{Pattern: pattern, Desc: desc, Limits: []string{"", ""}} g := &Glob{Pattern: pattern, Desc: desc, Limits: []string{"", ""}}
if pattern == "*" { if strings.HasPrefix(pattern, "*") {
g.IsGlob = true g.IsGlob = true
return g return g
} }