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 56D0C431FAF for ; Sun, 8 Sep 2013 08:51:07 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: 0 X-Spam-Level: X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none] 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 Kd50h9bsxXae for ; Sun, 8 Sep 2013 08:51:01 -0700 (PDT) Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34]) by olra.theworths.org (Postfix) with ESMTP id 853D5431FAE for ; Sun, 8 Sep 2013 08:51:01 -0700 (PDT) Received: from guru.guru-group.fi (localhost [IPv6:::1]) by guru.guru-group.fi (Postfix) with ESMTP id 2DB18100090; Sun, 8 Sep 2013 18:50:53 +0300 (EEST) From: Tomi Ollila To: "Kevin J. McCarthy" , notmuch@notmuchmail.org Subject: Re: [PATCH v2 1/1] notmuch-mutt: Fix tagging issues In-Reply-To: <20130907170757.GA407@zaogao.lan> References: <20130906221520.GC4226@zaogao.lan> <20130907155748.GD4226@zaogao.lan> <20130907170757.GA407@zaogao.lan> User-Agent: Notmuch/0.16+60~gbdcc747 (http://notmuchmail.org) Emacs/24.3.1 (x86_64-unknown-linux-gnu) X-Face: HhBM'cA~ MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: Stefano Zacchiroli 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: Sun, 08 Sep 2013 15:51:07 -0000 On Sat, Sep 07 2013, "Kevin J. McCarthy" wrote: > This patch fixes three issues with "notmuch-mutt tag": > > 1. The message_id was not shell quoted. > Thanks to Jason Miller for the bug report and patch. > > 2. The tags passed into tag_action() were not being properly quoted. > The "join before shell_quote" was combining multiple tags into a > single argument to notmuch tag: '+one -two -three' instead of > '+one' '-two' '-three'. > > 3. A "--" was added between the tags and search-term as shown in the > current notmuch-tag man page. > > Thanks to Tomi Ollila for suggesting the simple fix of using > the list form of system(), which bypasses the shell. > --- LGTM. Tomi > contrib/notmuch-mutt/notmuch-mutt | 4 +--- > 1 file changed, 1 insertion(+), 3 deletions(-) > > diff --git a/contrib/notmuch-mutt/notmuch-mutt b/contrib/notmuch-mutt/not= much-mutt > index c69b35c..4969e4b 100755 > --- a/contrib/notmuch-mutt/notmuch-mutt > +++ b/contrib/notmuch-mutt/notmuch-mutt > @@ -113,9 +113,7 @@ sub tag_action(@) { > my $mid =3D get_message_id(); > defined $mid or die "notmuch-mutt: cannot find Message-Id, abort.\n"; >=20=20 > - system("notmuch tag " > - . shell_quote(join(' ', @_)) > - . " id:$mid"); > + system("notmuch", "tag", @_, "--", "id:$mid"); > } >=20=20 > sub die_usage() { > --=20 > 1.8.4.rc3 > > _______________________________________________ > notmuch mailing list > notmuch@notmuchmail.org > http://notmuchmail.org/mailman/listinfo/notmuch --=20 "kaik on m=C3=A4nt!"