branch: elpa/geiser-chicken
commit 1854a3986a6d651b580463e3c071f8976e95aec2
Author: Noam Postavsky <[email protected]>
Commit: Noam Postavsky <[email protected]>
geiser-chicken--version: Don't use a shell
Using shell-command-to-string requires making assumptions about how
quoting works in the shell. While single quotes are okay for bourne
shells, it doesn't work for cmd.exe (the default on Windows).
Use call-process instead to remove dependency on shell quoting
details.
---
elisp/geiser-chicken.el | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/elisp/geiser-chicken.el b/elisp/geiser-chicken.el
index 170858a..251bce8 100644
--- a/elisp/geiser-chicken.el
+++ b/elisp/geiser-chicken.el
@@ -260,14 +260,17 @@ This function uses `geiser-chicken-init-file' if it
exists."
(defconst geiser-chicken-minimum-version "4.8.0.0")
(defun geiser-chicken--version (binary)
- (shell-command-to-string
- (format "%s -e '(display \
+ (cl-destructuring-bind (program . args)
+ (append (if (listp binary) binary (list binary))
+ '("-e" "(display \
(or (handle-exceptions exn \
#f \
(eval `(begin (import chicken.platform) \
(chicken-version)))) \
- (chicken-version)))'"
- (if (listp binary) (car binary) binary))))
+ (chicken-version)))"))
+ (with-temp-buffer
+ (apply #'call-process program nil '(t t) t args)
+ (buffer-string))))
(defun connect-to-chicken ()
"Start a Chicken REPL connected to a remote process."