emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/exec-path-from-shell ab268a035a 026/114: Use the system-wi


From: ELPA Syncer
Subject: [nongnu] elpa/exec-path-from-shell ab268a035a 026/114: Use the system-wide printf binary (if available) instead of shell built-in
Date: Tue, 5 Sep 2023 03:59:58 -0400 (EDT)

branch: elpa/exec-path-from-shell
commit ab268a035a35fcf4db7ab0ed8c104e36759735e0
Author: Steve Purcell <steve@sanityinc.com>
Commit: Steve Purcell <steve@sanityinc.com>

    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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]