diff options
author | Matt Snider <matt.snider@protonmail.com> | 2019-10-27 13:54:22 +0000 |
---|---|---|
committer | Drew DeVault <sir@cmpwn.com> | 2019-11-01 11:02:01 -0400 |
commit | cd39e8f90cde6adb3d127454f99184d84d74d40c (patch) | |
tree | 832b874872121219e00108429ffb891f659db3c8 /worker/notmuch | |
parent | 310bec27024579e7ada35585b3190ab875540804 (diff) | |
download | aerc-cd39e8f90cde6adb3d127454f99184d84d74d40c.tar.gz |
notmuch: ignore comments and blank lines when processing query-map file
A segmentation fault occurs when using the notmuch backend and a `query-map`
file that contains blank lines or comments.
Diffstat (limited to 'worker/notmuch')
-rw-r--r-- | worker/notmuch/worker.go | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/worker/notmuch/worker.go b/worker/notmuch/worker.go index 96adc291..be213bf6 100644 --- a/worker/notmuch/worker.go +++ b/worker/notmuch/worker.go @@ -387,6 +387,10 @@ func (w *worker) loadQueryMap(acctConfig *config.AccountConfig) error { scanner := bufio.NewScanner(f) for scanner.Scan() { line := scanner.Text() + if line == "" || line[0] == '#' { + continue + } + split := strings.SplitN(line, "=", 2) if len(split) != 2 { return fmt.Errorf("invalid line %q, want name=query", line) |