From: Eli Zaretskii Date: Fri, 27 Jul 2012 10:29:26 +0000 (+0300) Subject: Fix listn introduced in 2012-07-27T06:04:35Z!dmantipov@yandex.ru. X-Git-Tag: emacs-24.2.90~1058 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=bcfbc9de654b0718d46349ca8ada284dba3dc761;p=emacs.git Fix listn introduced in 2012-07-27T06:04:35Z!dmantipov@yandex.ru. src/alloc.c (listn): Fix the order the arguments are consed onto the list. --- diff --git a/src/ChangeLog b/src/ChangeLog index 54b34eb5c00..ab870b56f1e 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,8 @@ 2012-07-27 Eli Zaretskii + * alloc.c (listn): Fix the order the arguments are consed onto the + list. + * lisp.h (enum constype): Use CONSTYPE_HEAP and CONSTYPE_PURE for enumeration constants, as PURE and HEAP are too general, and clash with other headers and sources, such as gmalloc.c and the diff --git a/src/alloc.c b/src/alloc.c index 27426cdff66..a551dd821b8 100644 --- a/src/alloc.c +++ b/src/alloc.c @@ -2832,7 +2832,7 @@ listn (enum constype type, ptrdiff_t count, Lisp_Object arg, ...) objp[i] = va_arg (ap, Lisp_Object); va_end (ap); - for (i = 0, val = Qnil; i < count; i++) + for (val = Qnil, i = count - 1; i >= 0; i--) { if (type == CONSTYPE_PURE) val = pure_cons (objp[i], val);