X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=blobdiff_plain;f=notmuch-search.c;h=aa6662bd73b62b3708e363f196abc9abf39b0f0e;hp=91266c35b2635152d6b439fd960f2c3c4a2d9ad8;hb=637f99d8f3f45867d0a856503f9f302333824c07;hpb=333486572517d2e2084d66208de59085f21d8573 diff --git a/notmuch-search.c b/notmuch-search.c index 91266c35..aa6662bd 100644 --- a/notmuch-search.c +++ b/notmuch-search.c @@ -129,13 +129,18 @@ notmuch_search_command (void *ctx, int argc, char *argv[]) if (config == NULL) return 1; - notmuch = notmuch_database_open (notmuch_config_get_database_path (config)); + notmuch = notmuch_database_open (notmuch_config_get_database_path (config), + NOTMUCH_DATABASE_MODE_READ_ONLY); if (notmuch == NULL) return 1; 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; }