[notmuch] [PATCH] Quote file names passed to the shell
authorJed Brown <jed@59A2.org>
Sat, 21 Nov 2009 02:37:54 +0000 (03:37 +0100)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:35:37 +0000 (09:35 -0800)
ad/e412bfabceaae1dbb1a54dd8b7fea83a179964 [new file with mode: 0644]

diff --git a/ad/e412bfabceaae1dbb1a54dd8b7fea83a179964 b/ad/e412bfabceaae1dbb1a54dd8b7fea83a179964
new file mode 100644 (file)
index 0000000..c23c359
--- /dev/null
@@ -0,0 +1,97 @@
+Return-Path: <five9a2@gmail.com>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+       by olra.theworths.org (Postfix) with ESMTP id D86BA431FBC\r
+       for <notmuch@notmuchmail.org>; Fri, 20 Nov 2009 18:37:36 -0800 (PST)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+       by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+       with ESMTP id tvj5g8OwUi2x for <notmuch@notmuchmail.org>;\r
+       Fri, 20 Nov 2009 18:37:36 -0800 (PST)\r
+Received: from mail-bw0-f224.google.com (mail-bw0-f224.google.com\r
+       [209.85.218.224])\r
+       by olra.theworths.org (Postfix) with ESMTP id 0CE54431FAE\r
+       for <notmuch@notmuchmail.org>; Fri, 20 Nov 2009 18:37:35 -0800 (PST)\r
+Received: by bwz24 with SMTP id 24so2830528bwz.30\r
+       for <notmuch@notmuchmail.org>; Fri, 20 Nov 2009 18:37:34 -0800 (PST)\r
+DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;\r
+       h=domainkey-signature:received:received:sender:from:to:cc:subject\r
+       :date:message-id:x-mailer:mime-version:content-type;\r
+       bh=uERsGBdf88MmXA5YF8pzf7ejvhi2lD0fTGBnSUjD/3Y=;\r
+       b=nNP+G3hXdPp4PEhdej1Egrs5En4Z6ifLIZRri6QTif/FztwNrZqRn4OmyDEuTvXhh3\r
+       tht4xgd5EHudIVj5haySqhNeu+Ri5NRPj1MCy5/Uu/1lxWAFb3C+OlceLVpTgesOdLP0\r
+       XGVJXzE/yNBDV4NGAA/uD63VUvazSOSaIvxkc=\r
+DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma;\r
+       h=sender:from:to:cc:subject:date:message-id:x-mailer:mime-version\r
+       :content-type;\r
+       b=RRqAdaSZeVex0OU/D9ZTGI3SY4v7m9M47n9LivFqJyUBSu/iUPDiPfgxMf1nvk1q2L\r
+       HAjLllY+eE0y3nkT4O8DXxQbKtRIQ1nxFwEVLCPLJABin2tiNcUI7hMZgOXSIo3Je5Cj\r
+       GTYhtuAOFslz4E1p2djM/nyI/9zxiq+qiPVaU=\r
+Received: by 10.204.11.17 with SMTP id r17mr2200620bkr.41.1258771054539;\r
+       Fri, 20 Nov 2009 18:37:34 -0800 (PST)\r
+Received: from localhost.localdomain (vawpc43.ethz.ch [129.132.59.11])\r
+       by mx.google.com with ESMTPS id p9sm2299222fkb.14.2009.11.20.18.37.32\r
+       (version=TLSv1/SSLv3 cipher=RC4-MD5);\r
+       Fri, 20 Nov 2009 18:37:33 -0800 (PST)\r
+Sender: Jed Brown <five9a2@gmail.com>\r
+From: Jed Brown <jed@59A2.org>\r
+To: notmuch@notmuchmail.org\r
+Date: Sat, 21 Nov 2009 03:37:54 +0100\r
+Message-Id: <1258771074-25997-1-git-send-email-jed@59A2.org>\r
+X-Mailer: git-send-email 1.6.5.3\r
+MIME-Version: 1.0\r
+Content-Type: multipart/mixed; boundary="------------1.6.5.3"\r
+Subject: [notmuch] [PATCH] Quote file names passed to the shell\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.12\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+       <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Sat, 21 Nov 2009 02:37:37 -0000\r
+\r
+This is a multi-part message in MIME format.\r
+--------------1.6.5.3\r
+Content-Type: text/plain; charset=UTF-8; format=fixed\r
+Content-Transfer-Encoding: 8bit\r
+\r
+\r
+Prior to this, notmuch-show-pipe-message could not handle file names\r
+with spaces and similar.\r
+---\r
+ notmuch.el |    3 ++-\r
+ 1 files changed, 2 insertions(+), 1 deletions(-)\r
+\r
+\r
+--------------1.6.5.3\r
+Content-Type: text/x-patch;\r
+ name="0001-Quote-file-names-passed-to-the-shell.patch"\r
+Content-Transfer-Encoding: 8bit\r
+Content-Disposition: attachment;\r
+ filename="0001-Quote-file-names-passed-to-the-shell.patch"\r
+\r
+diff --git a/notmuch.el b/notmuch.el\r
+index cd3780f..1ca633d 100644\r
+--- a/notmuch.el\r
++++ b/notmuch.el\r
+@@ -281,7 +281,8 @@ The given command will be executed with the raw contents of the\r
+ current email message as stdin. Anything printed by the command\r
+ to stdout or stderr will appear in the *Messages* buffer."\r
+   (interactive "sPipe message to command: ")\r
+-  (apply 'start-process-shell-command "notmuch-pipe-command" "*notmuch-pipe*" (split-string (concat command " < " (notmuch-show-get-filename)))))\r
++  (apply 'start-process-shell-command "notmuch-pipe-command" "*notmuch-pipe*"\r
++       (list command " < " (shell-quote-argument (notmuch-show-get-filename)))))\r
\r
+ (defun notmuch-show-move-to-current-message-summary-line ()\r
+   "Move to the beginning of the one-line summary of the current message.\r
+\r
+--------------1.6.5.3--\r
+\r
+\r