all: use strings.Contains instead Index

Signed-off-by: Elena Morozova <lelenanam@gmail.com>
Upstream-commit: a37027f6bdcb2f035fcccd99c6c6064934623a04
Component: engine
This commit is contained in:
Elena Morozova
2016-10-13 14:18:43 -07:00
parent 02f69e1006
commit 70177b59a1
2 changed files with 2 additions and 2 deletions

View File

@ -180,7 +180,7 @@ func regexpMatch(pattern, path string) (bool, error) {
} else if ch == '?' {
// "?" is any char except "/"
regStr += "[^" + escSL + "]"
} else if strings.Index(".$", string(ch)) != -1 {
} else if ch == '.' || ch == '$' {
// Escape some regexp special chars that have no meaning
// in golang's filepath.Match
regStr += `\` + string(ch)