aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorinwit <inwit@sindominio.net>2022-11-04 14:21:56 +0100
committerRobin Jarry <robin@jarry.cc>2022-11-09 21:16:33 +0100
commit7ce091bc13eef9e59aef3c357b85cd918a8594b3 (patch)
tree21ffd40332a003a7dcfa031d96e30129840c641c
parent20554d8460e96a408cfd779e1158dec78b639028 (diff)
downloadaerc-7ce091bc13eef9e59aef3c357b85cd918a8594b3.tar.gz
notmuch: allow whitespace before '=' in query-map
When reading the query-map file, any white spaces before the '=' were read as part of the query name. Trim any leading and trailing white space from the query name. Signed-off-by: inwit <inwit@sindominio.net> Acked-by: Tim Culverhouse <tim@timculverhouse.com>
-rw-r--r--worker/notmuch/worker.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/worker/notmuch/worker.go b/worker/notmuch/worker.go
index 13c9d976..3b0ee829 100644
--- a/worker/notmuch/worker.go
+++ b/worker/notmuch/worker.go
@@ -572,8 +572,8 @@ func (w *worker) loadQueryMap(acctConfig *config.AccountConfig) error {
if len(split) != 2 {
return fmt.Errorf("%v: invalid line %q, want name=query", file, line)
}
- w.nameQueryMap[split[0]] = split[1]
- w.queryMapOrder = append(w.queryMapOrder, split[0])
+ w.nameQueryMap[strings.TrimSpace(split[0])] = split[1]
+ w.queryMapOrder = append(w.queryMapOrder, strings.TrimSpace(split[0]))
}
return nil
}