branch: elpa/exec-path-from-shell
commit ab268a035a35fcf4db7ab0ed8c104e36759735e0
Author: Steve Purcell <[email protected]>
Commit: Steve Purcell <[email protected]>
Use the system-wide printf binary (if available) instead of shell built-in
The hope is that this might allow fish to work. See #5.
---
exec-path-from-shell.el | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/exec-path-from-shell.el b/exec-path-from-shell.el
index 6312add7f4..59e774eee5 100644
--- a/exec-path-from-shell.el
+++ b/exec-path-from-shell.el
@@ -92,9 +92,11 @@ by printf.
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 they may contain $ etc."
- (let ((printf-command
- (concat "printf '__RESULT\\000" str "' "
- (mapconcat #'exec-path-from-shell--double-quote args " "))))
+ (let* ((printf-bin (or (executable-find "printf") "printf"))
+ (printf-command
+ (concat printf-bin
+ " '__RESULT\\000" str "' "
+ (mapconcat #'exec-path-from-shell--double-quote args " "))))
(with-temp-buffer
(let ((shell (getenv "SHELL")))
(call-process shell nil (current-buffer) nil