]> git.notmuchmail.org Git - notmuch/blobdiff - notmuch-search.c
notmuch search: Avoid infinite stream of exceptions from "notmuch search"
[notmuch] / notmuch-search.c
index 91266c35b2635152d6b439fd960f2c3c4a2d9ad8..2b1c0fea950d01ae0c37e30accfc1256cd0c5f93 100644 (file)
@@ -135,7 +135,11 @@ notmuch_search_command (void *ctx, int argc, char *argv[])
 
     query_str = query_string_from_args (ctx, argc, argv);
     if (query_str == NULL) {
-       fprintf (stderr, "Out of moemory.\n");
+       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;
     }