Commit 5e2e0fa4 authored by Eli Zaretskii's avatar Eli Zaretskii

Fix bug #17539 with infinite recursion during scroll commands.

 src/xdisp.c (move_it_in_display_line_to): Avoid infinite recursion:
 when closest_pos is identical to to_charpos, don't recurse, since
 we already tried that, and failed.
parent b0df8b95
2014-05-21 Eli Zaretskii <eliz@gnu.org>
* xdisp.c (move_it_in_display_line_to): Avoid infinite recursion:
when closest_pos is identical to to_charpos, don't recurse, since
we already tried that, and failed. (Bug#17539)
2014-05-20 Eli Zaretskii <eliz@gnu.org>
* w32fns.c (unwind_create_frame) [GLYPH_DEBUG]: If we are
......
......@@ -8812,8 +8812,11 @@ move_it_in_display_line_to (struct it *it,
if (closest_pos < ZV)
{
RESTORE_IT (it, &ppos_it, ppos_data);
move_it_in_display_line_to (it, closest_pos, -1,
MOVE_TO_POS);
/* Don't recurse if closest_pos is equal to
to_charpos, since we have just tried that. */
if (closest_pos != to_charpos)
move_it_in_display_line_to (it, closest_pos, -1,
MOVE_TO_POS);
result = MOVE_POS_MATCH_OR_ZV;
}
else
......@@ -8874,8 +8877,9 @@ move_it_in_display_line_to (struct it *it,
&& !at_eob_p && closest_pos < ZV)
{
RESTORE_IT (it, &ppos_it, ppos_data);
move_it_in_display_line_to (it, closest_pos, -1,
MOVE_TO_POS);
if (closest_pos != to_charpos)
move_it_in_display_line_to (it, closest_pos, -1,
MOVE_TO_POS);
}
result = MOVE_POS_MATCH_OR_ZV;
break;
......@@ -8893,7 +8897,9 @@ move_it_in_display_line_to (struct it *it,
if (closest_pos < ZV)
{
RESTORE_IT (it, &ppos_it, ppos_data);
move_it_in_display_line_to (it, closest_pos, -1, MOVE_TO_POS);
if (closest_pos != to_charpos)
move_it_in_display_line_to (it, closest_pos, -1,
MOVE_TO_POS);
}
result = MOVE_POS_MATCH_OR_ZV;
break;
......
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