diff --git a/eval.go b/eval.go index 9a46fd20..db6addac 100644 --- a/eval.go +++ b/eval.go @@ -297,6 +297,14 @@ func (e *setExpr) eval(app *app, args []string) { case "shellopts": gOpts.shellopts = strings.Split(e.val, ":") case "hiddenfiles": + toks := strings.Split(e.val, ":") + for _, s := range toks { + _, err := filepath.Match(s, "a") + if err != nil { + app.ui.echoerrf("hiddenfiles: %s", err) + return + } + } gOpts.hiddenfiles = strings.Split(e.val, ":") default: app.ui.echoerrf("unknown option: %s", e.opt) diff --git a/os.go b/os.go index 56bf0617..fc7b43a0 100644 --- a/os.go +++ b/os.go @@ -159,12 +159,10 @@ func matchPattern(pattern, name, path string) bool { matchStr = filepath.Join(path, name) } - isMatch, err := filepath.Match(pattern, matchStr) - if err != nil { - log.Printf("pattern %s caused error with %s", pattern, matchStr) - return false - } - return isMatch + // pattern errors are checked when 'hiddenfiles' option is set + matched, _ := filepath.Match(pattern, matchStr) + + return matched } func exportFiles(f string, fs []string) {