--- /dev/null
+Return-Path: <m.walters@qmul.ac.uk>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+ by olra.theworths.org (Postfix) with ESMTP id 07EF8431FB6\r
+ for <notmuch@notmuchmail.org>; Fri, 21 Jun 2013 23:50:20 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -1.098\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-1.098 tagged_above=-999 required=5\r
+ tests=[DKIM_ADSP_CUSTOM_MED=0.001, FREEMAIL_FROM=0.001,\r
+ NML_ADSP_CUSTOM_MED=1.2, RCVD_IN_DNSWL_MED=-2.3] autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+ by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+ with ESMTP id iowm1FtpDtXq for <notmuch@notmuchmail.org>;\r
+ Fri, 21 Jun 2013 23:50:12 -0700 (PDT)\r
+Received: from mail2.qmul.ac.uk (mail2.qmul.ac.uk [138.37.6.6])\r
+ (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))\r
+ (No client certificate requested)\r
+ by olra.theworths.org (Postfix) with ESMTPS id E540C431FAE\r
+ for <notmuch@notmuchmail.org>; Fri, 21 Jun 2013 23:50:11 -0700 (PDT)\r
+Received: from smtp.qmul.ac.uk ([138.37.6.40])\r
+ by mail2.qmul.ac.uk with esmtp (Exim 4.71)\r
+ (envelope-from <m.walters@qmul.ac.uk>)\r
+ id 1UqHe7-0008PS-R0; Sat, 22 Jun 2013 07:50:06 +0100\r
+Received: from 93-97-24-31.zone5.bethere.co.uk ([93.97.24.31] helo=localhost)\r
+ by smtp.qmul.ac.uk with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.71)\r
+ (envelope-from <m.walters@qmul.ac.uk>)\r
+ id 1UqHe7-0007bh-Gm; Sat, 22 Jun 2013 07:50:03 +0100\r
+From: Mark Walters <markwalters1009@gmail.com>\r
+To: Peter Wang <novalazy@gmail.com>, notmuch@notmuchmail.org\r
+Subject: Re: [PATCH v6 01/12] tag-util: move out 'tag' command-line checks\r
+In-Reply-To: <1371880008-18312-2-git-send-email-novalazy@gmail.com>\r
+References: <1371880008-18312-1-git-send-email-novalazy@gmail.com>\r
+ <1371880008-18312-2-git-send-email-novalazy@gmail.com>\r
+User-Agent: Notmuch/0.15.2+171~ge2f30a2 (http://notmuchmail.org) Emacs/23.4.1\r
+ (x86_64-pc-linux-gnu)\r
+Date: Sat, 22 Jun 2013 07:50:00 +0100\r
+Message-ID: <87ppvevduv.fsf@qmul.ac.uk>\r
+MIME-Version: 1.0\r
+Content-Type: text/plain; charset=us-ascii\r
+X-Sender-Host-Address: 93.97.24.31\r
+X-QM-SPAM-Info: Sender has good ham record. :)\r
+X-QM-Body-MD5: 7062fce1babddeb672b6ec6050de6852 (of first 20000 bytes)\r
+X-SpamAssassin-Score: -0.0\r
+X-SpamAssassin-SpamBar: /\r
+X-SpamAssassin-Report: The QM spam filters have analysed this message to\r
+ determine if it is\r
+ spam. We require at least 5.0 points to mark a message as spam.\r
+ This message scored -0.0 points.\r
+ Summary of the scoring: \r
+ * 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail\r
+ provider * (markwalters1009[at]gmail.com)\r
+ * -0.0 AWL AWL: From: address is in the auto white-list\r
+X-QM-Scan-Virus: ClamAV says the message is clean\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+ <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+ <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+ <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Sat, 22 Jun 2013 06:50:20 -0000\r
+\r
+\r
+\r
+I am working my way through the series: I have done everything except\r
+the main patch (3/12). As I think one more series is needed please can you\r
+update this commit message as it is now only moving one error condition\r
+(since Jani already moved the other)\r
+\r
+> parse_tag_command_line checked for two error conditions which are\r
+> specific to the 'tag' command. It can be reused for the forthcoming\r
+> notmuch 'insert' command if we move the checks out, into notmuch-tag.c.\r
+\r
+Best wishes\r
+\r
+Mark\r
+ \r
+\r
+> ---\r
+> notmuch-tag.c | 5 +++++\r
+> tag-util.c | 6 +++---\r
+> 2 files changed, 8 insertions(+), 3 deletions(-)\r
+>\r
+> diff --git a/notmuch-tag.c b/notmuch-tag.c\r
+> index 9a5d3e7..3b09df9 100644\r
+> --- a/notmuch-tag.c\r
+> +++ b/notmuch-tag.c\r
+> @@ -247,6 +247,11 @@ notmuch_tag_command (notmuch_config_t *config, int argc, char *argv[])\r
+> fprintf (stderr, "Error: 'notmuch tag' requires at least one tag to add or remove.\n");\r
+> return 1;\r
+> }\r
+> +\r
+> + if (*query_string == '\0') {\r
+> + fprintf (stderr, "Error: notmuch tag requires at least one search term.\n");\r
+> + return 1;\r
+> + }\r
+> }\r
+> \r
+> if (notmuch_database_open (notmuch_config_get_database_path (config),\r
+> diff --git a/tag-util.c b/tag-util.c\r
+> index c5f5859..92e08a1 100644\r
+> --- a/tag-util.c\r
+> +++ b/tag-util.c\r
+> @@ -190,9 +190,9 @@ parse_tag_command_line (void *ctx, int argc, char **argv,\r
+> \r
+> *query_str = query_string_from_args (ctx, argc - i, &argv[i]);\r
+> \r
+> - if (*query_str == NULL || **query_str == '\0') {\r
+> - fprintf (stderr, "Error: notmuch tag requires at least one search term.\n");\r
+> - return TAG_PARSE_INVALID;\r
+> + if (*query_str == NULL) {\r
+> + fprintf (stderr, "Out of memory.\n");\r
+> + return TAG_PARSE_OUT_OF_MEMORY;\r
+> }\r
+> \r
+> return TAG_PARSE_SUCCESS;\r
+> -- \r
+> 1.7.12.1\r
+>\r
+> _______________________________________________\r
+> notmuch mailing list\r
+> notmuch@notmuchmail.org\r
+> http://notmuchmail.org/mailman/listinfo/notmuch\r