Commit 85946364 authored by Kim F. Storm's avatar Kim F. Storm
Browse files

(mapcar1): Maybe exit loop if original sequence was modified.

parent 89fe657e
......@@ -3132,9 +3132,9 @@ mapcar1 (leni, vals, fn, seq)
else /* Must be a list, since Flength did not get an error */
{
tail = seq;
for (i = 0; i < leni; i++)
for (i = 0; i < leni && CONSP (tail); i++)
{
dummy = call1 (fn, Fcar (tail));
dummy = call1 (fn, XCAR (tail));
if (vals)
vals[i] = dummy;
tail = XCDR (tail);
......@@ -3172,7 +3172,7 @@ SEQUENCE may be a list, a vector, a bool-vector, or a string. */)
mapcar1 (leni, args, function, sequence);
UNGCPRO;
for (i = leni - 1; i >= 0; i--)
for (i = leni - 1; i > 0; i--)
args[i + i] = args[i];
for (i = 1; i < nargs; i += 2)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment