From cd39e8f90cde6adb3d127454f99184d84d74d40c Mon Sep 17 00:00:00 2001 From: Matt Snider Date: Sun, 27 Oct 2019 13:54:22 +0000 Subject: 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. --- worker/notmuch/worker.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/worker/notmuch/worker.go b/worker/notmuch/worker.go index 96adc29..be213bf 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) -- cgit v1.2.3