aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/contrib/emacs
diff options
context:
space:
mode:
authorTino Calancha <tino.calancha@gmail.com>2022-03-06 23:06:56 +0100
committerTino Calancha <tino.calancha@gmail.com>2022-03-06 23:30:56 +0100
commitc4d8a1d815e79ddd89a85d3e36a41d29f0475771 (patch)
tree47ca2f1e0ed275c2622cbec51644ee2ee2eaaf3a /contrib/emacs
parentEnsure compatibility with tree 2.0 (diff)
downloadpassword-store-c4d8a1d815e79ddd89a85d3e36a41d29f0475771.tar.xz
password-store-c4d8a1d815e79ddd89a85d3e36a41d29f0475771.zip
emacs: Fix an infloop on Windows enviroments
The infloop has been observed in calls to `pasword-store--run' for pass v1.7.4 in a Windows/WSL2 enviroment. When this happens, the sentinel in `password-store--run-1' doesn't call the callback. * contrib/emacs/password-store.el (password-store--run-1): Prefer `process-status' over the string comparison to check the process status. Problem reported by Kai Tetzlaff <pwstore@tetzco.de>: https://lists.zx2c4.com/pipermail/password-store/2022-February/004583.html
Diffstat (limited to 'contrib/emacs')
-rw-r--r--contrib/emacs/CHANGELOG.md4
-rw-r--r--contrib/emacs/password-store.el5
2 files changed, 7 insertions, 2 deletions
diff --git a/contrib/emacs/CHANGELOG.md b/contrib/emacs/CHANGELOG.md
index 7173f65..ed85577 100644
--- a/contrib/emacs/CHANGELOG.md
+++ b/contrib/emacs/CHANGELOG.md
@@ -1,3 +1,7 @@
+# 2.1.5
+
+* (bugfix) Fix an infloop on Windows enviroments.
+
# 2.1.4
* Drop dependency on f library.
diff --git a/contrib/emacs/password-store.el b/contrib/emacs/password-store.el
index 61c339e..1d23090 100644
--- a/contrib/emacs/password-store.el
+++ b/contrib/emacs/password-store.el
@@ -88,9 +88,10 @@ or outputs error message on failure."
(setq output (concat output text)))
:sentinel (lambda (process state)
(cond
- ((string= state "finished\n")
+ ((and (eq (process-status process) 'exit)
+ (zerop (process-exit-status process)))
(funcall callback output))
- ((string= state "open\n") (accept-process-output process))
+ ((eq (process-status process) 'run) (accept-process-output process))
(t (error (concat "password-store: " state))))))))
(defun password-store--run (&rest args)