* src/xdisp.c (move_it_to, display_line): Make sure ZV_BYTE is
greater than 1 before fetching previous byte.
&& (IT_CHARPOS (*it) > to_charpos
|| (IT_CHARPOS (*it) == to_charpos
&& to_charpos == ZV
- && FETCH_BYTE (ZV_BYTE - 1) != '\n')))
+ && (ZV_BYTE <= 1 || FETCH_BYTE (ZV_BYTE - 1) != '\n'))))
{
reached = 9;
goto out;
the logical order. */
if (IT_BYTEPOS (*it) > BEG_BYTE)
row->ends_at_zv_p =
- IT_BYTEPOS (*it) >= ZV_BYTE && FETCH_BYTE (ZV_BYTE - 1) != '\n';
+ IT_BYTEPOS (*it) >= ZV_BYTE
+ && (ZV_BYTE <= 1 || FETCH_BYTE (ZV_BYTE - 1) != '\n');
else
row->ends_at_zv_p = false;
break;