mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-01-05 19:31:02 -08:00
(Fprimitive_undo): GCPRO next and list.
Check argument type before calling XINT.
This commit is contained in:
parent
55b4889367
commit
de65837bbe
1 changed files with 9 additions and 2 deletions
11
src/undo.c
11
src/undo.c
|
|
@ -335,8 +335,10 @@ Return what remains of the list.")
|
|||
(n, list)
|
||||
Lisp_Object n, list;
|
||||
{
|
||||
struct gcpro gcpro1, gcpro2;
|
||||
Lisp_Object next;
|
||||
int count = specpdl_ptr - specpdl;
|
||||
register int arg = XINT (n);
|
||||
register int arg;
|
||||
#if 0 /* This is a good feature, but would make undo-start
|
||||
unable to do what is expected. */
|
||||
Lisp_Object tem;
|
||||
|
|
@ -348,6 +350,11 @@ Return what remains of the list.")
|
|||
list = Fcdr (list);
|
||||
#endif
|
||||
|
||||
CHECK_NUMBER (n, 0);
|
||||
arg = XINT (n);
|
||||
next = Qnil;
|
||||
GCPRO2 (next, list);
|
||||
|
||||
/* Don't let read-only properties interfere with undo. */
|
||||
if (NILP (current_buffer->read_only))
|
||||
specbind (Qinhibit_read_only, Qt);
|
||||
|
|
@ -356,7 +363,6 @@ Return what remains of the list.")
|
|||
{
|
||||
while (1)
|
||||
{
|
||||
Lisp_Object next;
|
||||
next = Fcar (list);
|
||||
list = Fcdr (list);
|
||||
/* Exit inner loop at undo boundary. */
|
||||
|
|
@ -455,6 +461,7 @@ Return what remains of the list.")
|
|||
arg--;
|
||||
}
|
||||
|
||||
UNGCPRO;
|
||||
return unbind_to (count, list);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue