Re: [Kevin McCarthy] Bug#966100: notmuch-mutt: symlinking now fails for indexed mailboxes with a space in the name

Subject: Re: [Kevin McCarthy] Bug#966100: notmuch-mutt: symlinking now fails for indexed mailboxes with a space in the name

Date: Sun, 26 Jul 2020 15:10:59 -0600

To: Stefano Zacchiroli

Cc: notmuch@notmuchmail.org

From: Greg Anders


 From 92221d856e663450c1f55b9ec9a6aa69b4d27b3d Mon Sep 17 00:00:00 2001
From: Greg Anders <pub@gpanders.com>
Date: Sun, 26 Jul 2020 14:57:56 -0600
Subject: [PATCH] notmuch-mutt: quote variables to prevent word splitting

This fixes a bug where mail under directories with spaces in their names
would not be found.
---
  contrib/notmuch-mutt/notmuch-mutt | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/contrib/notmuch-mutt/notmuch-mutt b/contrib/notmuch-mutt/notmuch-mutt
index d33223bd..8ab1849f 100755
--- a/contrib/notmuch-mutt/notmuch-mutt
+++ b/contrib/notmuch-mutt/notmuch-mutt
@@ -50,7 +50,7 @@ sub search($$$) {
      empty_maildir($maildir);
      system("notmuch search --output=files $dup_option $query"
  	   . " | sed -e 's: :\\\\ :g'"
-	   . " | while IFS= read -r searchoutput; do ln -s \$searchoutput $maildir/cur/; done");
+	   . " | while IFS= read -r searchoutput; do ln -s \"\$searchoutput\" $maildir/cur/; done");
  }
  
  sub prompt($$) {
-- 
2.27.0
_______________________________________________
notmuch mailing list -- notmuch@notmuchmail.org
To unsubscribe send an email to notmuch-leave@notmuchmail.org

Thread: