summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorDaniel Xu <dxu@dxuuu.xyz>2019-08-19 22:10:48 -0700
committerDrew DeVault <sir@cmpwn.com>2019-08-20 16:03:37 +0900
commit6fcc047c3116b6ef59cae39b3beb9e815f9b62a6 (patch)
treebbe1386eae936e6d114f78ada7f23e4cba33ee93
parent334ca89bea38132252d092ad6066af100768eff7 (diff)
downloadaerc-6fcc047c3116b6ef59cae39b3beb9e815f9b62a6.tar.gz
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: 334ca89bea381 ("folder filter: only assume regex if filter is
~fmt")

Signed-off-by: Daniel Xu <dxu@dxuuu.xyz>
-rw-r--r--widgets/dirlist.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/widgets/dirlist.go b/widgets/dirlist.go
index 68ba61c..6214c8e 100644
--- a/widgets/dirlist.go
+++ b/widgets/dirlist.go
@@ -165,7 +165,7 @@ func folderMatches(folder string, pattern string) bool {
 		return false
 	}
 	if pattern[0] == '~' {
-		r, err := regexp.Compile(pattern)
+		r, err := regexp.Compile(pattern[1:])
 		if err != nil {
 			return false
 		}