Mercurial > emacs
comparison src/composite.c @ 98068:9723eb0d11ab
(FORWARD_CHAR): Check STOP after incrementing (POSITION).pos.
author | Kenichi Handa <handa@m17n.org> |
---|---|
date | Sun, 07 Sep 2008 01:11:46 +0000 |
parents | 59bcf1726f2c |
children | 2eda9a0daa3e |
comparison
equal
deleted
inserted
replaced
98067:72d94dcf4480 | 98068:9723eb0d11ab |
---|---|
1187 }; | 1187 }; |
1188 | 1188 |
1189 /* Update the members of POSTION to the next character boundary. */ | 1189 /* Update the members of POSTION to the next character boundary. */ |
1190 #define FORWARD_CHAR(POSITION, STOP) \ | 1190 #define FORWARD_CHAR(POSITION, STOP) \ |
1191 do { \ | 1191 do { \ |
1192 (POSITION).pos++; \ | |
1192 if ((POSITION).pos == (STOP)) \ | 1193 if ((POSITION).pos == (STOP)) \ |
1193 (POSITION).p = GAP_END_ADDR; \ | 1194 { \ |
1194 (POSITION).pos++; \ | 1195 (POSITION).p = GAP_END_ADDR; \ |
1195 (POSITION).pos_byte += BYTES_BY_CHAR_HEAD (*((POSITION).p)); \ | 1196 (POSITION).pos_byte = GPT_BYTE; \ |
1196 (POSITION).p += BYTES_BY_CHAR_HEAD (*((POSITION).p)); \ | 1197 } \ |
1198 else \ | |
1199 { \ | |
1200 (POSITION).p += BYTES_BY_CHAR_HEAD (*((POSITION).p)); \ | |
1201 (POSITION).pos_byte += BYTES_BY_CHAR_HEAD (*((POSITION).p)); \ | |
1202 } \ | |
1197 } while (0) | 1203 } while (0) |
1198 | 1204 |
1199 /* Update the members of POSTION to the previous character boundary. */ | 1205 /* Update the members of POSTION to the previous character boundary. */ |
1200 #define BACKWARD_CHAR(POSITION, STOP) \ | 1206 #define BACKWARD_CHAR(POSITION, STOP) \ |
1201 do { \ | 1207 do { \ |