branch: elpa/exec-path-from-shell
commit 5736cc87e47052bf1bacd9ce5807e5cf3a2c6a71
Author: Tim Hill <[email protected]>
Commit: Tim Hill <[email protected]>
Add sentinel to exec-path-from-shell-printf (closes #41)
---
exec-path-from-shell.el | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/exec-path-from-shell.el b/exec-path-from-shell.el
index 3384897516..4637f716e2 100644
--- a/exec-path-from-shell.el
+++ b/exec-path-from-shell.el
@@ -149,7 +149,7 @@ shell-escaped, so they may contain $ etc."
(let* ((printf-bin (or (executable-find "printf") "printf"))
(printf-command
(concat printf-bin
- " '__RESULT\\000" str "' "
+ " '__RESULT\\000" str "\\000__RESULT' "
(mapconcat #'exec-path-from-shell--double-quote args " ")))
(shell (exec-path-from-shell--shell))
(shell-args (append exec-path-from-shell-arguments
@@ -165,7 +165,7 @@ shell-escaped, so they may contain $ etc."
(error "Non-zero exit code from shell %s invoked with args %S.
Output was:\n%S"
shell shell-args (buffer-string))))
(goto-char (point-min))
- (if (re-search-forward "__RESULT\0\\(.*\\)" nil t)
+ (if (re-search-forward "__RESULT\0\\(.*\\)\0__RESULT" nil t)
(match-string 1)
(error "Expected printf output from shell, but got: %S"
(buffer-string))))))