summaryrefslogtreecommitdiff
path: root/contrib
diff options
context:
space:
mode:
Diffstat (limited to 'contrib')
-rw-r--r--contrib/emacs/password-store.el15
1 files changed, 10 insertions, 5 deletions
diff --git a/contrib/emacs/password-store.el b/contrib/emacs/password-store.el
index 746f133..e9acaad 100644
--- a/contrib/emacs/password-store.el
+++ b/contrib/emacs/password-store.el
@@ -54,11 +54,16 @@
Nil arguments are ignored. Returns the output on success, or
outputs error message on failure."
(with-temp-buffer
- (let ((exit-code
- (apply 'call-process
- (append
- (list password-store-executable nil (current-buffer) nil)
- (-reject 'null args)))))
+ (let* ((tempfile (make-temp-file ""))
+ (exit-code
+ (apply 'call-process
+ (append
+ (list password-store-executable nil (list t tempfile) nil)
+ (-reject 'null args)))))
+ (unless (zerop exit-code)
+ (erase-buffer)
+ (insert-file-contents tempfile))
+ (delete-file tempfile)
(if (zerop exit-code)
(s-chomp (buffer-string))
(error (s-chomp (buffer-string)))))))