From 0ab6a3d89628513c77248a90ecff1e72a044773d Mon Sep 17 00:00:00 2001 From: Kenichi Handa Date: Thu, 22 Jan 1998 01:26:45 +0000 Subject: [PATCH] (mapcar1): Keep `i' in `i_before' before `i' is incremented by FETCH_STRING_CHAR_ADVANCE. --- src/fns.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/fns.c b/src/fns.c index dabd05ab2cf..421879fde9f 100644 --- a/src/fns.c +++ b/src/fns.c @@ -1995,9 +1995,11 @@ mapcar1 (leni, vals, fn, seq) for (i = 0, i_byte = 0; i < leni;) { int c; - FETCH_STRING_CHAR_ADVANCE (c, seq, i, i_byte) + int i_before = i; + + FETCH_STRING_CHAR_ADVANCE (c, seq, i, i_byte); XSETFASTINT (dummy, c); - vals[i] = call1 (fn, dummy); + vals[i_before] = call1 (fn, dummy); } } else /* Must be a list, since Flength did not get an error */ -- 2.39.2