-#!/usr/bin/perl -w
+#!/usr/bin/env perl
#
# notmuch-mutt - notmuch (of a) helper for Mutt
#
empty_maildir($maildir);
system("notmuch search --output=files $dup_option $query"
. " | sed -e 's: :\\\\ :g'"
- . " | xargs -r -I searchoutput ln -s searchoutput $maildir/cur/");
+ . " | while IFS= read -r searchoutput; do ln -s \$searchoutput $maildir/cur/; done");
}
sub prompt($$) {
$mid = $1;
} else { # Message-ID header not found, synthesize a message id
# based on SHA1, as notmuch would do. See:
- # http://git.notmuchmail.org/git/notmuch/blob/HEAD:/lib/sha1.c
+ # https://git.notmuchmail.org/git/notmuch/blob/HEAD:/lib/sha1.c
my $sha = Digest::SHA->new(1);
$sha->add($_) foreach(@headers);
$sha->addfile(\*STDIN);