From: Kenichi Handa Date: Sun, 7 Sep 2008 01:11:46 +0000 (+0000) Subject: (FORWARD_CHAR): Check STOP after incrementing (POSITION).pos. X-Git-Tag: emacs-pretest-23.0.90~2978 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=900c44863023c036567ab88967944c35c051f430;p=emacs.git (FORWARD_CHAR): Check STOP after incrementing (POSITION).pos. --- diff --git a/src/composite.c b/src/composite.c index 6e9c823d8c1..dc1dd370c3b 100644 --- a/src/composite.c +++ b/src/composite.c @@ -1189,11 +1189,17 @@ struct position_record /* Update the members of POSTION to the next character boundary. */ #define FORWARD_CHAR(POSITION, STOP) \ do { \ - if ((POSITION).pos == (STOP)) \ - (POSITION).p = GAP_END_ADDR; \ (POSITION).pos++; \ - (POSITION).pos_byte += BYTES_BY_CHAR_HEAD (*((POSITION).p)); \ - (POSITION).p += BYTES_BY_CHAR_HEAD (*((POSITION).p)); \ + if ((POSITION).pos == (STOP)) \ + { \ + (POSITION).p = GAP_END_ADDR; \ + (POSITION).pos_byte = GPT_BYTE; \ + } \ + else \ + { \ + (POSITION).p += BYTES_BY_CHAR_HEAD (*((POSITION).p)); \ + (POSITION).pos_byte += BYTES_BY_CHAR_HEAD (*((POSITION).p)); \ + } \ } while (0) /* Update the members of POSTION to the previous character boundary. */