aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDavid Bremner <david@tethera.net>2022-06-04 18:53:58 -0300
committerDavid Bremner <david@tethera.net>2022-06-25 19:49:55 -0300
commite7ffb7404163ebb453c96f6af9724e0fba75abb0 (patch)
treef2b32349cd111825142b3ac0a5587fbcb71b8175 /lib
parent78632345868b5e4753ad402c806c29569946ce89 (diff)
lib/sexp: allow * as alias for "" in range searches.
It can be tedious to use "" inside of a string, e.g. in a shell script.
Diffstat (limited to 'lib')
-rw-r--r--lib/parse-sexp.cc5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/parse-sexp.cc b/lib/parse-sexp.cc
index 6282a456..6814c9fc 100644
--- a/lib/parse-sexp.cc
+++ b/lib/parse-sexp.cc
@@ -473,6 +473,9 @@ _sexp_parse_range (notmuch_database_t *notmuch, const _sexp_prefix_t *prefix,
}
from = sx->val;
+ if (strcmp (from, "*") == 0)
+ from = "";
+
to = from;
if (sx->next) {
@@ -488,6 +491,8 @@ _sexp_parse_range (notmuch_database_t *notmuch, const _sexp_prefix_t *prefix,
}
to = sx->next->val;
+ if (strcmp (to, "*") == 0)
+ to = "";
}
if (strcmp (prefix->name, "date") == 0) {