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.
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) {