branch: elpa/exec-path-from-shell
commit 9f034cdb97fb00044470084473bcb99b8a5b7d2d
Author: Steve Purcell <[email protected]>
Commit: Steve Purcell <[email protected]>

    Explicitly double-quote args, so empty var values don't mess things up
    
    Fixes #6
---
 exec-path-from-shell.el | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/exec-path-from-shell.el b/exec-path-from-shell.el
index 8640d491e1..188c18cb2b 100644
--- a/exec-path-from-shell.el
+++ b/exec-path-from-shell.el
@@ -79,7 +79,9 @@ ARGS is an optional list of args which will be inserted by 
printf
 in place of any % placeholders in STR.  ARGS are not automatically
 shell-escaped, so that may contain $ etc."
   (let ((printf-command (concat "printf '__RESULT\\000" str "' "
-                                (mapconcat #'identity args " "))))
+                                (mapconcat (lambda (a) (concat "\"" a "\""))
+                                           args
+                                           " "))))
     (with-temp-buffer
       (call-process (getenv "SHELL") nil (current-buffer) nil
                     "--login" "-i" "-c" printf-command)

Reply via email to