]> git.eshelyaron.com Git - emacs.git/commitdiff
(FORWARD_CHAR): Check STOP after incrementing (POSITION).pos.
authorKenichi Handa <handa@m17n.org>
Sun, 7 Sep 2008 01:11:46 +0000 (01:11 +0000)
committerKenichi Handa <handa@m17n.org>
Sun, 7 Sep 2008 01:11:46 +0000 (01:11 +0000)
src/composite.c

index 6e9c823d8c1f216b61c04a633eefad8ff83f3f5a..dc1dd370c3bbdeb08808849c9a48eb409c1f82d4 100644 (file)
@@ -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.  */