mirror of
https://git.notmuchmail.org/git/notmuch
synced 2024-11-22 02:48:08 +01:00
notmuch search: Avoid infinite stream of exceptions from "notmuch search"
That is, give a nice error message and exit if no search terms are provided. Thanks to Priit Laes <plaes@plaes.org> for reporting the error and providing an early version of the fix.
This commit is contained in:
parent
26a4741b9c
commit
306635c27d
1 changed files with 4 additions and 0 deletions
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue