From b19b9cbe514a8b75ec20e0056cba91b465057614 Mon Sep 17 00:00:00 2001 From: Po Lu Date: Sun, 20 Mar 2022 12:51:46 +0800 Subject: [PATCH] Check list tail properly in x-begin-drag * src/xfns.c (Fx_begin_drag): Check that TARGETS is actually a proper list. * src/xterm.c (x_dnd_update_state): Remove debugging code. --- src/xfns.c | 5 ++++- src/xterm.c | 2 -- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/xfns.c b/src/xfns.c index b5d0b2c54e8..9d30f2adee1 100644 --- a/src/xfns.c +++ b/src/xfns.c @@ -6620,10 +6620,11 @@ instead. */) int ntargets = 0; char *target_names[2048]; Atom *target_atoms; - Lisp_Object lval; + Lisp_Object lval, original; Atom xaction; CHECK_LIST (targets); + original = targets; for (; CONSP (targets); targets = XCDR (targets)) { @@ -6638,6 +6639,8 @@ instead. */) error ("Too many targets"); } + CHECK_LIST_END (targets, original); + if (NILP (action) || EQ (action, QXdndActionCopy)) xaction = FRAME_DISPLAY_INFO (f)->Xatom_XdndActionCopy; else if (EQ (action, QXdndActionMove)) diff --git a/src/xterm.c b/src/xterm.c index 3e7b51e4db3..01840569fef 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -10606,8 +10606,6 @@ x_dnd_update_state (struct x_display_info *dpyinfo) unsigned int dummy_mask; Window dummy, dummy_child, target; - puts ("us"); - if (XQueryPointer (dpyinfo->display, dpyinfo->root_window, &dummy, &dummy_child, -- 2.39.2