From: Alex Botero-Lowry <alex.boterolowry@gmail.com>
To: notmuch@notmuchmail.org
Subject: [PATCH] Error out if no query is supplied to search instead of going into an infinite loop
Date: Tue, 17 Nov 2009 16:23:53 -0800 [thread overview]
Message-ID: <cf0c4d610911171623q3e27a0adx802e47039b57604b@mail.gmail.com> (raw)
[-- Attachment #1.1: Type: text/plain, Size: 1290 bytes --]
In this case error out when no query is supplied. There seems to be an
infinite-loop casued by i think notmuch_query_search_threads having
an exception:
A Xapian exception occurred: Syntax: <expression> AND <expression>
A Xapian exception occurred: Syntax: <expression> AND <expression>
A Xapian exception occurred: Syntax: <expression> AND <expression>
A Xapian exception occurred: Syntax: <expression> AND <expression>
A Xapian exception occurred: Syntax: <expression> AND <expression>
A Xapian exception occurred: Syntax: <expression> AND <expression>
A Xapian exception occurred: Syntax: <expression> AND <expression>
A Xapian exception occurred: Syntax: <expression> AND <expression>
A Xapian exception occurred: Syntax: <expression> AND <expression>
A Xapian exception occurred: Syntax: <expression> AND <expression>
A Xapian exception occurred: Syntax: <expression> AND <expression>
A Xapian exception occurred: Syntax: <expression> AND <expression>
A Xapian exception occurred: Syntax: <expression> AND <expression>
A Xapian exception occurred: Syntax: <expression> AND <expression>
A Xapian exception occurred: Syntax: <expression> AND <expression>
I'll look into that bug specifically a bit later.
It might be better to do a usage instead of just throwing an error here?
alex
[-- Attachment #1.2: Type: text/html, Size: 1553 bytes --]
[-- Attachment #2: 0001-Error-out-if-no-query-is-supplied-to-search-instead-.patch --]
[-- Type: application/octet-stream, Size: 794 bytes --]
From 3f9431f74a5ff66c84c869a3e26c2bad42bed1b1 Mon Sep 17 00:00:00 2001
From: Alexander Botero-Lowry <alex.boterolowry@gmail.com>
Date: Tue, 17 Nov 2009 16:20:28 -0800
Subject: [PATCH] Error out if no query is supplied to search instead of going into an infinite loop
---
notmuch-search.c | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/notmuch-search.c b/notmuch-search.c
index 8db09c7..d94fccd 100644
--- a/notmuch-search.c
+++ b/notmuch-search.c
@@ -66,6 +66,11 @@ notmuch_search_command (void *ctx, int argc, char *argv[])
argc -= i;
argv += i;
+ if (argc == 0) {
+ fprintf (stderr, "No query provided\n");
+ return 1;
+ }
+
config = notmuch_config_open (ctx, NULL, NULL);
if (config == NULL)
return 1;
--
1.6.5.2
next reply other threads:[~2009-11-18 0:23 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-11-18 0:23 Alex Botero-Lowry [this message]
2009-11-18 11:31 ` [PATCH] Error out if no query is supplied to search instead of going into an infinite loop Carl Worth
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://notmuchmail.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=cf0c4d610911171623q3e27a0adx802e47039b57604b@mail.gmail.com \
--to=alex.boterolowry@gmail.com \
--cc=notmuch@notmuchmail.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://yhetil.org/notmuch.git/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).