commit c4d8a1d815e79ddd89a85d3e36a41d29f0475771
parent eea24967a002a2a81ae9b97a1fe972b5287f3a09
Author: Tino Calancha <tino.calancha@gmail.com>
Date: Sun, 6 Mar 2022 23:06:56 +0100
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:
2 files changed, 7 insertions(+), 2 deletions(-)
diff --git 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
@@ -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)