From: Kim F. Storm Date: Thu, 15 Sep 2005 12:06:39 +0000 (+0000) Subject: (move_it_vertically): Don't try to fetch byte BEGV-1. X-Git-Tag: emacs-pretest-22.0.90~7095 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=ad5afd5bf392106e2a21fdc1d8ae2cb134d00ce5;p=emacs.git (move_it_vertically): Don't try to fetch byte BEGV-1. (reseat_at_next_visible_line_start): Likewise (in xassert). --- diff --git a/src/xdisp.c b/src/xdisp.c index 0b34856aa6a..aa81fe7a3db 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -4807,7 +4807,8 @@ reseat_at_next_visible_line_start (it, on_newline_p) && indented_beyond_p (IT_CHARPOS (*it), IT_BYTEPOS (*it), (double) it->selective)) /* iftc */ { - xassert (FETCH_BYTE (IT_BYTEPOS (*it) - 1) == '\n'); + xassert (IT_BYTEPOS (*it) == BEGV + || FETCH_BYTE (IT_BYTEPOS (*it) - 1) == '\n'); newline_found_p = forward_to_next_line_start (it, &skipped_p); } @@ -6525,6 +6526,7 @@ move_it_vertically (it, dy) /* If buffer ends in ZV without a newline, move to the start of the line to satisfy the post-condition. */ if (IT_CHARPOS (*it) == ZV + && ZV > BEGV && FETCH_BYTE (IT_BYTEPOS (*it) - 1) != '\n') move_it_by_lines (it, 0, 0); }