]> git.eshelyaron.com Git - emacs.git/commitdiff
Remove unreliable assertion in buf_bytepos_to_charpos
authorEli Zaretskii <eliz@gnu.org>
Tue, 5 Mar 2019 16:25:23 +0000 (18:25 +0200)
committerEli Zaretskii <eliz@gnu.org>
Tue, 5 Mar 2019 16:25:23 +0000 (18:25 +0200)
* src/marker.c (buf_bytepos_to_charpos): Remove the assertion
regarding bytepos always at the head byte of a multibyte
sequence.  For the reasons, see
http://lists.gnu.org/archive/html/emacs-devel/2019-03/msg00100.html
http://lists.gnu.org/archive/html/emacs-devel/2019-03/msg00102.html

src/marker.c

index 6755993bfac51fc03e09609aad7b02176465bc6a..b58051a8c2b9dc2739f804b8e9034d441345d013 100644 (file)
@@ -332,12 +332,6 @@ buf_bytepos_to_charpos (struct buffer *b, ptrdiff_t bytepos)
   if (best_above == best_above_byte)
     return bytepos;
 
-#if 0
-  /* Check bytepos is not in the middle of a character. */
-  eassert (bytepos >= BUF_Z_BYTE (b)
-           || CHAR_HEAD_P (BUF_FETCH_BYTE (b, bytepos)));
-#endif
-
   best_below = BEG;
   best_below_byte = BEG_BYTE;