database error
[notmuch-archives.git] / b7 / 57309f56f919e8b9466b82c760b9115d3aac0e
1 Return-Path: <novalazy@gmail.com>\r
2 X-Original-To: notmuch@notmuchmail.org\r
3 Delivered-To: notmuch@notmuchmail.org\r
4 Received: from localhost (localhost [127.0.0.1])\r
5         by olra.theworths.org (Postfix) with ESMTP id 9A27B431FBF\r
6         for <notmuch@notmuchmail.org>; Fri, 21 Jun 2013 22:47:07 -0700 (PDT)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: -0.799\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-0.799 tagged_above=-999 required=5\r
12         tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,\r
13         FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\r
14 Received: from olra.theworths.org ([127.0.0.1])\r
15         by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
16         with ESMTP id fBtYeTCKOpQB for <notmuch@notmuchmail.org>;\r
17         Fri, 21 Jun 2013 22:47:00 -0700 (PDT)\r
18 Received: from mail-pb0-f50.google.com (mail-pb0-f50.google.com\r
19         [209.85.160.50]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
20         (No client certificate requested)\r
21         by olra.theworths.org (Postfix) with ESMTPS id EC592431FB6\r
22         for <notmuch@notmuchmail.org>; Fri, 21 Jun 2013 22:46:59 -0700 (PDT)\r
23 Received: by mail-pb0-f50.google.com with SMTP id wz7so8692658pbc.9\r
24         for <notmuch@notmuchmail.org>; Fri, 21 Jun 2013 22:46:59 -0700 (PDT)\r
25 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;\r
26         h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references;\r
27         bh=ooGzRAw3WlQ1H9Bfy5Sd5QgRpxwLuzpkeSE1GT2LMuU=;\r
28         b=Ih4qzpwEdJqfaJ4WKHGwA8E0hfw4gCFFTLg3sjdjL6X+Mm1ylu78k5ka45x55w0+o6\r
29         mozV3TBGIUgC/3n56P36LhTFAd6VPEASN8rMsWiTbhhybtx6FSqrg4yfqMNyQhIvqthT\r
30         gcPI8dIkiilaKHmpIJSV+EQd+H23jO3UuZteFBWbh7JDB7rI9wsaRa61PwvOypuAVBuQ\r
31         NbR7SAlXOxGIWlC0Ff6zBdFvLlSqzJoCfic9z0emDSjJqv0t9c3CCVliroyEc5R/D47p\r
32         s+uXElOFvkOy49TnKgpBbuEk9nsIwTEnzvxnGcArd4FBI57YwANtmmy84WVIzpH8toUI\r
33         fxEQ==\r
34 X-Received: by 10.69.12.65 with SMTP id eo1mr15065012pbd.205.1371880019244;\r
35         Fri, 21 Jun 2013 22:46:59 -0700 (PDT)\r
36 Received: from localhost (215.42.233.220.static.exetel.com.au.\r
37         [220.233.42.215])\r
38         by mx.google.com with ESMTPSA id bg3sm7840531pbb.44.2013.06.21.22.46.56\r
39         for <multiple recipients>\r
40         (version=TLSv1.2 cipher=RC4-SHA bits=128/128);\r
41         Fri, 21 Jun 2013 22:46:58 -0700 (PDT)\r
42 From: Peter Wang <novalazy@gmail.com>\r
43 To: notmuch@notmuchmail.org\r
44 Subject: [PATCH v6 01/12] tag-util: move out 'tag' command-line checks\r
45 Date: Sat, 22 Jun 2013 15:46:37 +1000\r
46 Message-Id: <1371880008-18312-2-git-send-email-novalazy@gmail.com>\r
47 X-Mailer: git-send-email 1.7.12.1\r
48 In-Reply-To: <1371880008-18312-1-git-send-email-novalazy@gmail.com>\r
49 References: <1371880008-18312-1-git-send-email-novalazy@gmail.com>\r
50 X-BeenThere: notmuch@notmuchmail.org\r
51 X-Mailman-Version: 2.1.13\r
52 Precedence: list\r
53 List-Id: "Use and development of the notmuch mail system."\r
54         <notmuch.notmuchmail.org>\r
55 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
56         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
57 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
58 List-Post: <mailto:notmuch@notmuchmail.org>\r
59 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
60 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
61         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
62 X-List-Received-Date: Sat, 22 Jun 2013 05:47:07 -0000\r
63 \r
64 parse_tag_command_line checked for two error conditions which are\r
65 specific to the 'tag' command.  It can be reused for the forthcoming\r
66 notmuch 'insert' command if we move the checks out, into notmuch-tag.c.\r
67 ---\r
68  notmuch-tag.c | 5 +++++\r
69  tag-util.c    | 6 +++---\r
70  2 files changed, 8 insertions(+), 3 deletions(-)\r
71 \r
72 diff --git a/notmuch-tag.c b/notmuch-tag.c\r
73 index 9a5d3e7..3b09df9 100644\r
74 --- a/notmuch-tag.c\r
75 +++ b/notmuch-tag.c\r
76 @@ -247,6 +247,11 @@ notmuch_tag_command (notmuch_config_t *config, int argc, char *argv[])\r
77             fprintf (stderr, "Error: 'notmuch tag' requires at least one tag to add or remove.\n");\r
78             return 1;\r
79         }\r
80 +\r
81 +       if (*query_string == '\0') {\r
82 +           fprintf (stderr, "Error: notmuch tag requires at least one search term.\n");\r
83 +           return 1;\r
84 +       }\r
85      }\r
86  \r
87      if (notmuch_database_open (notmuch_config_get_database_path (config),\r
88 diff --git a/tag-util.c b/tag-util.c\r
89 index c5f5859..92e08a1 100644\r
90 --- a/tag-util.c\r
91 +++ b/tag-util.c\r
92 @@ -190,9 +190,9 @@ parse_tag_command_line (void *ctx, int argc, char **argv,\r
93  \r
94      *query_str = query_string_from_args (ctx, argc - i, &argv[i]);\r
95  \r
96 -    if (*query_str == NULL || **query_str == '\0') {\r
97 -       fprintf (stderr, "Error: notmuch tag requires at least one search term.\n");\r
98 -       return TAG_PARSE_INVALID;\r
99 +    if (*query_str == NULL) {\r
100 +       fprintf (stderr, "Out of memory.\n");\r
101 +       return TAG_PARSE_OUT_OF_MEMORY;\r
102      }\r
103  \r
104      return TAG_PARSE_SUCCESS;\r
105 -- \r
106 1.7.12.1\r
107 \r