[PATCH 1/4] cli: make caller check tag count in parse_tag_command_line
authorJani Nikula <jani@nikula.org>
Tue, 22 Jan 2013 17:41:06 +0000 (19:41 +0200)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:53:17 +0000 (09:53 -0800)
65/2fd292d52f6d22e66b4c6890c1574658519068 [new file with mode: 0644]

diff --git a/65/2fd292d52f6d22e66b4c6890c1574658519068 b/65/2fd292d52f6d22e66b4c6890c1574658519068
new file mode 100644 (file)
index 0000000..533bd95
--- /dev/null
@@ -0,0 +1,105 @@
+Return-Path: <jani@nikula.org>\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 C3C87431FAF\r
+       for <notmuch@notmuchmail.org>; Tue, 22 Jan 2013 09:41:15 -0800 (PST)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -0.7\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5\r
+       tests=[RCVD_IN_DNSWL_LOW=-0.7] 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 zYb9MZRYWXQZ for <notmuch@notmuchmail.org>;\r
+       Tue, 22 Jan 2013 09:41:15 -0800 (PST)\r
+Received: from mail-lb0-f173.google.com (mail-lb0-f173.google.com\r
+       [209.85.217.173]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
+       (No client certificate requested)\r
+       by olra.theworths.org (Postfix) with ESMTPS id 199D1431FAE\r
+       for <notmuch@notmuchmail.org>; Tue, 22 Jan 2013 09:41:14 -0800 (PST)\r
+Received: by mail-lb0-f173.google.com with SMTP id gf7so4544241lbb.4\r
+       for <notmuch@notmuchmail.org>; Tue, 22 Jan 2013 09:41:12 -0800 (PST)\r
+X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;\r
+       d=google.com; s=20120113;\r
+       h=x-received:from:to:cc:subject:date:message-id:x-mailer\r
+       :x-gm-message-state;\r
+       bh=Yf60HqK5H68IYpMF2TIm3/fMp1CjveJOez2AATppMII=;\r
+       b=BzV3un0UJe3/V0iwKk//0bKDOvtdPJmaJxXoqfxc5i8DST4Ucf7BUHR+OMlXKAU264\r
+       gCUWNZuq+2f5apAlREFy7Ge1aPxxNb2qU1/RYFWME1aCxyacjcesF0lSxi765bI/a3N8\r
+       URLUYGP0wVJoo9R+l8vgJmih5Y3r1cv3wiyuji0L1l8str+fNAhbfKc+nt0uewX36QCC\r
+       SGvsRc/E7t2PnPO1597o3S2q3wjt0K+WYViUJm1qJ3viAKUvTKqzv6Wjv9szi87zAusB\r
+       QUgMuW9OWJ0cGoZk0fxyvEeIo++0EIB+z7uu1tsmmHyz+RrCTtsD4XY0cC2v75xwsrMb\r
+       FcCA==\r
+X-Received: by 10.112.32.100 with SMTP id h4mr9668588lbi.53.1358876471897;\r
+       Tue, 22 Jan 2013 09:41:11 -0800 (PST)\r
+Received: from localhost (dsl-hkibrasgw4-50df51-27.dhcp.inet.fi.\r
+       [80.223.81.27])\r
+       by mx.google.com with ESMTPS id er8sm7340723lbb.9.2013.01.22.09.41.09\r
+       (version=TLSv1.2 cipher=RC4-SHA bits=128/128);\r
+       Tue, 22 Jan 2013 09:41:10 -0800 (PST)\r
+From: Jani Nikula <jani@nikula.org>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH 1/4] cli: make caller check tag count in\r
+ parse_tag_command_line\r
+Date: Tue, 22 Jan 2013 19:41:06 +0200\r
+Message-Id:\r
+ <1a2c09adc1c963f1aa209c09143f85dca7634e11.1358876448.git.jani@nikula.org>\r
+X-Mailer: git-send-email 1.7.10.4\r
+X-Gm-Message-State:\r
+ ALoCoQnlk8s0N05sjM2Fr+SL2Al0Ao3DClxSP44fXjkM75eSc5+ifCfjlO3Cko1qUsM+jm4iXpHq\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: Tue, 22 Jan 2013 17:41:15 -0000\r
+\r
+---\r
+ notmuch-tag.c |    5 +++++\r
+ tag-util.c    |    5 -----\r
+ 2 files changed, 5 insertions(+), 5 deletions(-)\r
+\r
+diff --git a/notmuch-tag.c b/notmuch-tag.c\r
+index d9daf8f..b2b22f7 100644\r
+--- a/notmuch-tag.c\r
++++ b/notmuch-tag.c\r
+@@ -234,6 +234,11 @@ notmuch_tag_command (void *ctx, int argc, char *argv[])\r
+       if (parse_tag_command_line (ctx, argc - opt_index, argv + opt_index,\r
+                                   &query_string, tag_ops))\r
+           return 1;\r
++\r
++      if (tag_op_list_size (tag_ops) == 0) {\r
++          fprintf (stderr, "Error: 'notmuch tag' requires at least one tag to add or remove.\n");\r
++          return 1;\r
++      }\r
+     }\r
\r
+     config = notmuch_config_open (ctx, NULL, NULL);\r
+diff --git a/tag-util.c b/tag-util.c\r
+index 701d329..c5f5859 100644\r
+--- a/tag-util.c\r
++++ b/tag-util.c\r
+@@ -188,11 +188,6 @@ parse_tag_command_line (void *ctx, int argc, char **argv,\r
+       tag_op_list_append (tag_ops, argv[i] + 1, is_remove);\r
+     }\r
\r
+-    if (tag_op_list_size (tag_ops) == 0) {\r
+-      fprintf (stderr, "Error: 'notmuch tag' requires at least one tag to add or remove.\n");\r
+-      return TAG_PARSE_INVALID;\r
+-    }\r
+-\r
+     *query_str = query_string_from_args (ctx, argc - i, &argv[i]);\r
\r
+     if (*query_str == NULL || **query_str == '\0') {\r
+-- \r
+1.7.10.4\r
+\r