Only compile regex portion of folder filter
The code was trying to compile the `~` as well. In this case, it was
trying to match a literal `~` to the front of the supplied regex.
Fixes: 334ca89bea
("folder filter: only assume regex if filter is
~fmt")
Signed-off-by: Daniel Xu <dxu@dxuuu.xyz>
This commit is contained in:
parent
334ca89bea
commit
6fcc047c31
1 changed files with 1 additions and 1 deletions
|
@ -165,7 +165,7 @@ func folderMatches(folder string, pattern string) bool {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
if pattern[0] == '~' {
|
if pattern[0] == '~' {
|
||||||
r, err := regexp.Compile(pattern)
|
r, err := regexp.Compile(pattern[1:])
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue