From: Stefan Monnier <monnier@iro.umontreal.ca>
Date: Sat, 19 Jul 2014 16:56:40 +0000 (-0400)
Subject: * lisp/xt-mouse.el (xterm-mouse-event): Don't assume last-click is non-nil.
X-Git-Tag: emacs-25.0.90~2636^2
X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=a54493b02fc90ab163aa88dfe68c2b5e44a2536e;p=emacs.git

* lisp/xt-mouse.el (xterm-mouse-event): Don't assume last-click is non-nil.

Fixes: debbugs:18015
---

diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index a468cbfc801..bf2024ac9b6 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,5 +1,8 @@
 2014-07-19  Stefan Monnier  <monnier@iro.umontreal.ca>
 
+	* xt-mouse.el (xterm-mouse-event): Don't assume last-click is non-nil
+	(bug#18015).
+
 	* rect.el (rectangle--string-preview): Don't assume there
 	a non-nil default (bug#17984).
 
diff --git a/lisp/xt-mouse.el b/lisp/xt-mouse.el
index 59f1eb8c887..cad3151b244 100644
--- a/lisp/xt-mouse.el
+++ b/lisp/xt-mouse.el
@@ -250,7 +250,7 @@ which is the \"1006\" extension implemented in Xterm >= 277."
            ((not (string-match "down-" name))
             ;; For up events, make the up side match the down side.
             (setq this-time last-time)
-            (when (and (> click-count 1)
+            (when (and click-count (> click-count 1)
                        (string-match "down-" last-name)
                        (equal name (replace-match "" t t last-name)))
               (xterm-mouse--set-click-count event click-count)))