From: Peter Wang Date: Sat, 22 Jun 2013 05:46:38 +0000 (+1000) Subject: [PATCH v6 02/12] tag-util: do not reset list in parse_tag_command_line X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=31da519dbd200b4099e9aed39caee83fae612f33;p=notmuch-archives.git [PATCH v6 02/12] tag-util: do not reset list in parse_tag_command_line --- diff --git a/de/de2855f99f770f3fe84d23f584d8bc361c4c7e b/de/de2855f99f770f3fe84d23f584d8bc361c4c7e new file mode 100644 index 000000000..4721bf450 --- /dev/null +++ b/de/de2855f99f770f3fe84d23f584d8bc361c4c7e @@ -0,0 +1,102 @@ +Return-Path: +X-Original-To: notmuch@notmuchmail.org +Delivered-To: notmuch@notmuchmail.org +Received: from localhost (localhost [127.0.0.1]) + by olra.theworths.org (Postfix) with ESMTP id E1694431FC3 + for ; Fri, 21 Jun 2013 22:47:10 -0700 (PDT) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: -0.799 +X-Spam-Level: +X-Spam-Status: No, score=-0.799 tagged_above=-999 required=5 + tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, + FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled +Received: from olra.theworths.org ([127.0.0.1]) + by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) + with ESMTP id suR9YvYFREIl for ; + Fri, 21 Jun 2013 22:47:05 -0700 (PDT) +Received: from mail-pa0-f42.google.com (mail-pa0-f42.google.com + [209.85.220.42]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) + (No client certificate requested) + by olra.theworths.org (Postfix) with ESMTPS id 013BE431FAE + for ; Fri, 21 Jun 2013 22:47:04 -0700 (PDT) +Received: by mail-pa0-f42.google.com with SMTP id rl6so8790420pac.15 + for ; Fri, 21 Jun 2013 22:47:04 -0700 (PDT) +DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; + h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; + bh=uGhCFmhR6GDSZO0Amme3lygoSxHmkPKNyhUcG7bsz4g=; + b=jNFyz8iFTbrBo5Vv9a4C56R3w3MgbDq+XwNLQ8lVGvkvVtk/IMjLruoUQ/xL8M7upy + fH9cHO6YoGmjiVtiiZynZZXPxHg64zUDtLdc4ZYS5Fg2/8BiwY/px0aQECwG221NC4x5 + DRIDjpIoAdrLbVgapxm0ZlzWW8EeUA2PlBu47UGIBzx+2KuPw4BedOYT7NwQEVf/Ht0t + R2fBrM0VcAbHEl/3sbW+w+DKgpBmBbgNuugHvzljQ0B+nkojM3Y/uOl2NFsvPoxSFRdV + oQcaUWdfmjcZpLmXNYRx3IBCp30A17fCZCOpkG4hIwQh7YXHCTgp+knwCyaMTxXz19YE + fMPQ== +X-Received: by 10.68.113.194 with SMTP id ja2mr15032747pbb.65.1371880024274; + Fri, 21 Jun 2013 22:47:04 -0700 (PDT) +Received: from localhost (215.42.233.220.static.exetel.com.au. + [220.233.42.215]) + by mx.google.com with ESMTPSA id tq8sm7868783pbc.30.2013.06.21.22.47.02 + for + (version=TLSv1.2 cipher=RC4-SHA bits=128/128); + Fri, 21 Jun 2013 22:47:03 -0700 (PDT) +From: Peter Wang +To: notmuch@notmuchmail.org +Subject: [PATCH v6 02/12] tag-util: do not reset list in + parse_tag_command_line +Date: Sat, 22 Jun 2013 15:46:38 +1000 +Message-Id: <1371880008-18312-3-git-send-email-novalazy@gmail.com> +X-Mailer: git-send-email 1.7.12.1 +In-Reply-To: <1371880008-18312-1-git-send-email-novalazy@gmail.com> +References: <1371880008-18312-1-git-send-email-novalazy@gmail.com> +X-BeenThere: notmuch@notmuchmail.org +X-Mailman-Version: 2.1.13 +Precedence: list +List-Id: "Use and development of the notmuch mail system." + +List-Unsubscribe: , + +List-Archive: +List-Post: +List-Help: +List-Subscribe: , + +X-List-Received-Date: Sat, 22 Jun 2013 05:47:11 -0000 + +No current callers of parse_tag_command_line require that it clear its +tag list argument. The notmuch 'insert' command will be better served +if the function modifies a pre-populated list (of new.tags) instead of +clobbering it outright. +--- + tag-util.c | 2 -- + tag-util.h | 2 ++ + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/tag-util.c b/tag-util.c +index 92e08a1..3bde409 100644 +--- a/tag-util.c ++++ b/tag-util.c +@@ -165,8 +165,6 @@ parse_tag_command_line (void *ctx, int argc, char **argv, + + int i; + +- tag_op_list_reset (tag_ops); +- + for (i = 0; i < argc; i++) { + if (strcmp (argv[i], "--") == 0) { + i++; +diff --git a/tag-util.h b/tag-util.h +index 246de85..4628f16 100644 +--- a/tag-util.h ++++ b/tag-util.h +@@ -81,6 +81,8 @@ parse_tag_line (void *ctx, char *line, + * Output Parameters: + * ops contains a list of tag operations + * query_str the search terms. ++ * ++ * The ops argument is not cleared. + */ + + tag_parse_status_t +-- +1.7.12.1 +