summaryrefslogtreecommitdiff
path: root/src/keyboard.c
diff options
context:
space:
mode:
authorEli Zaretskii <eliz@gnu.org>2006-08-05 11:59:50 +0000
committerEli Zaretskii <eliz@gnu.org>2006-08-05 11:59:50 +0000
commit29f68ca572325d2baef932d5bfb04ec626ee6e62 (patch)
tree178635057682dc7247dabbc5d994efc751b74745 /src/keyboard.c
parent147e62202603267199e70390439f0a3ed4336011 (diff)
downloademacs-29f68ca572325d2baef932d5bfb04ec626ee6e62.tar.gz
(kbd_buffer_get_event): Return Qnil when current time is exactly equal to
end_time, not only when it is past that.
Diffstat (limited to 'src/keyboard.c')
-rw-r--r--src/keyboard.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/keyboard.c b/src/keyboard.c
index a4e1c98c013..6f12994a1b8 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -3954,13 +3954,15 @@ kbd_buffer_get_event (kbp, used_mouse_menu, end_time)
{
EMACS_TIME duration;
EMACS_GET_TIME (duration);
- EMACS_SUB_TIME (duration, *end_time, duration);
- if (EMACS_TIME_NEG_P (duration))
- return Qnil;
+ if (EMACS_TIME_GE (duration, *end_time))
+ return Qnil; /* finished waiting */
else
- wait_reading_process_output (EMACS_SECS (duration),
- EMACS_USECS (duration),
- -1, 1, Qnil, NULL, 0);
+ {
+ EMACS_SUB_TIME (duration, *end_time, duration);
+ wait_reading_process_output (EMACS_SECS (duration),
+ EMACS_USECS (duration),
+ -1, 1, Qnil, NULL, 0);
+ }
}
else
wait_reading_process_output (0, 0, -1, 1, Qnil, NULL, 0);