From 7a6a97d7b9e970e757c1a9c96412ca351207ea0c Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Tue, 6 Nov 2001 15:07:31 +0000 Subject: [PATCH] (make_lispy_event): Check integerness and fix Lisp_Object/int mixup. --- src/ChangeLog | 5 +++++ src/keyboard.c | 7 ++++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index da2e7ffaa27..ddf6680a01d 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2001-11-06 Stefan Monnier + + * keyboard.c (make_lispy_event): Check integerness and fix + Lisp_Object/int mixup. + 2001-11-06 Pavel Jan,Bm(Bk * fns.c (copy_hash_table): Remove unused variable `v'. diff --git a/src/keyboard.c b/src/keyboard.c index ff430fddde7..2aa4b51ccf3 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -4996,10 +4996,11 @@ make_lispy_event (event) /* The third element of every position should be the (x,y) pair. */ down = Fcar (Fcdr (Fcdr (start_pos))); - if (CONSP (down)) + if (CONSP (down) + && INTEGERP (XCAR (down)) && INTEGERP (XCDR (down))) { - xdiff = event->x - XCAR (down); - ydiff = event->y - XCDR (down); + xdiff = XFASTINT (event->x) - XFASTINT (XCAR (down)); + ydiff = XFASTINT (event->y) - XFASTINT (XCDR (down)); } if (xdiff < double_click_fuzz && xdiff > - double_click_fuzz -- 2.39.5