From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by arlo.cworth.org (Postfix) with ESMTP id 857D76DE0209 for ; Wed, 28 Feb 2018 07:17:53 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: 0.479 X-Spam-Level: X-Spam-Status: No, score=0.479 tagged_above=-999 required=5 tests=[AWL=-0.173, SPF_NEUTRAL=0.652] autolearn=disabled Received: from arlo.cworth.org ([127.0.0.1]) by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 24jnR5yZGxsp for ; Wed, 28 Feb 2018 07:17:51 -0800 (PST) Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34]) by arlo.cworth.org (Postfix) with ESMTP id AA76A6DE01EF for ; Wed, 28 Feb 2018 07:17:50 -0800 (PST) Received: from guru.guru-group.fi (localhost [IPv6:::1]) by guru.guru-group.fi (Postfix) with ESMTP id 6AEF610008E; Wed, 28 Feb 2018 17:17:43 +0200 (EET) From: Tomi Ollila To: Jani Nikula , notmuch@notmuchmail.org Subject: Re: [PATCH] notmuch-mutt: use --format=text0 and xargs -0 In-Reply-To: <877eqygq0y.fsf@nikula.org> References: <20180227195739.32378-1-jani@nikula.org> <877eqygq0y.fsf@nikula.org> User-Agent: Notmuch/0.26~rc0+5~gaec2eb0 (https://notmuchmail.org) Emacs/25.2.1 (x86_64-unknown-linux-gnu) X-Face: HhBM'cA~ MIME-Version: 1.0 Content-Type: text/plain X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.26 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: Wed, 28 Feb 2018 15:17:53 -0000 On Tue, Feb 27 2018, Jani Nikula wrote: > On Tue, 27 Feb 2018, Jani Nikula wrote: >> notmuch-mutt fails for message files with special characters such as >> single quote in their filename. Use notmuch search --format=text0 and >> xargs -0 combo to handle them. >> >> Reported and tested by "dob1" on IRC. >> --- >> contrib/notmuch-mutt/notmuch-mutt | 4 ++-- >> 1 file changed, 2 insertions(+), 2 deletions(-) >> >> diff --git a/contrib/notmuch-mutt/notmuch-mutt b/contrib/notmuch-mutt/notmuch-mutt >> index 0e46a8c1b95e..57f13075aa22 100755 >> --- a/contrib/notmuch-mutt/notmuch-mutt >> +++ b/contrib/notmuch-mutt/notmuch-mutt >> @@ -48,9 +48,9 @@ sub search($$$) { >> } >> >> empty_maildir($maildir); >> - system("notmuch search --output=files $dup_option $query" >> + system("notmuch search --format=text0 --output=files $dup_option $query" >> . " | sed -e 's: :\\\\ :g'" > > Come to think of it, does this need sed -z too? it looks to me that sed can be dropped. btw how many non-coreutils xargs support -0 option ? > >> - . " | xargs -r -I searchoutput ln -s searchoutput $maildir/cur/"); >> + . " | xargs -0 -r -I searchoutput ln -s searchoutput $maildir/cur/"); >> } >> >> sub prompt($$) { >> -- >> 2.11.0 > _______________________________________________ > notmuch mailing list > notmuch@notmuchmail.org > https://notmuchmail.org/mailman/listinfo/notmuch