miqt-docker: change wildcard from * to - to avoid shell interpretation

This commit is contained in:
mappu 2025-04-29 22:43:13 +12:00
parent d075984e77
commit b2536be8d5

View File

@ -18,10 +18,10 @@ import (
)
// glob2regex converts the glob pattern into a regexp.
// It only supports `*` as a special character.
// It only supports `-` as a special character meaning 'anything'.
// The resulting regex is unanchored i.e. can match anywhere within a target string.
func glob2regex(pattern string) *regexp.Regexp {
parts := strings.Split(pattern, `*`)
parts := strings.Split(pattern, `-`)
for i, p := range parts {
parts[i] = regexp.QuoteMeta(p)
}