aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--notmuch-search.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/notmuch-search.c b/notmuch-search.c
index f7f9e70c..2b1c0fea 100644
--- a/notmuch-search.c
+++ b/notmuch-search.c
@@ -138,6 +138,10 @@ notmuch_search_command (void *ctx, int argc, char *argv[])
fprintf (stderr, "Out of memory.\n");
return 1;
}
+ if (*query_str == '\0') {
+ fprintf (stderr, "Error: notmuch search requires at least one search term.\n");
+ return 1;
+ }
query = notmuch_query_create (notmuch, query_str);
if (query == NULL) {