summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--chess-engine.el9
-rw-r--r--chess-phalanx.el5
2 files changed, 7 insertions, 7 deletions
diff --git a/chess-engine.el b/chess-engine.el
index b5067e8..2551bf7 100644
--- a/chess-engine.el
+++ b/chess-engine.el
@@ -387,7 +387,8 @@ function in all cases; this is merely a bandwidth-saver."
(if chess-engine-last-pos
(goto-char chess-engine-last-pos)
(goto-char (point-min)))
- (while (not (eobp))
+ (while (and (not (eobp))
+ (/= (line-end-position) (point-max)))
(let ((triggers chess-engine-regexp-alist))
(while triggers
;; this could be accelerated by joining
@@ -396,9 +397,9 @@ function in all cases; this is merely a bandwidth-saver."
(funcall (cdar triggers)))
(setq triggers nil)
(setq triggers (cdr triggers)))))
- (forward-line)))
- (setq chess-engine-last-pos (point)
- chess-engine-working nil)))))))
+ (forward-line))
+ (setq chess-engine-last-pos (point)))
+ (setq chess-engine-working nil)))))))
(provide 'chess-engine)
diff --git a/chess-phalanx.el b/chess-phalanx.el
index 417fa41..7b902a4 100644
--- a/chess-phalanx.el
+++ b/chess-phalanx.el
@@ -19,12 +19,11 @@
(defvar chess-phalanx-regexp-alist
(list
- (cons (concat "my move is \\(P?\\("
- chess-algebraic-regexp "\\)\\)\\s-*$")
+ (cons (concat "my move is P?\\(" chess-algebraic-regexp "\\)\\s-*$")
(function
(lambda ()
(funcall chess-engine-response-handler 'move
- (chess-engine-convert-algebraic (match-string 2))))))
+ (chess-engine-convert-algebraic (match-string 1))))))
(cons "Illegal move:\\s-*\\(.*\\)"
(function
(lambda ()