# HG changeset patch # User Richard M. Stallman # Date 1049661239 0 # Node ID 674bfa5d582dd48f0180e47d59903b800b6d1a90 # Parent dc1f6aa292852b6743c510e4e7f8aac0a6b7d49f (verify_bytepos): New function. diff -r dc1f6aa29285 -r 674bfa5d582d src/marker.c --- a/src/marker.c Sun Apr 06 20:32:52 2003 +0000 +++ b/src/marker.c Sun Apr 06 20:33:59 2003 +0000 @@ -252,6 +252,24 @@ } #undef CONSIDER + +/* Used for debugging: recompute the bytepos corresponding to CHARPOS + in the simplest, most reliable way. */ + +int +verify_bytepos (charpos) +{ + int below = 1; + int below_byte = 1; + + while (below != charpos) + { + below++; + BUF_INC_POS (current_buffer, below_byte); + } + + return below_byte; +} /* bytepos_to_charpos returns the char position corresponding to BYTEPOS. */