changeset: 4525:d64f1060cd6503ad009f196304b241f940a0fe23
tag: tip
user: Stephen J. Turnbull <stephen(a)xemacs.org>
date: Sat Nov 01 23:32:53 2008 +0900
files: src/ChangeLog src/mule-ccl.c src/text.c
description:
Fix off-by-one error in ccl_driver. <87iqr7v7p0.fsf(a)uwakimon.sk.tsukuba.ac.jp>
diff -r 03ba50f7ecd7fb0dee997f30f1f1b7af746c7493 -r
d64f1060cd6503ad009f196304b241f940a0fe23 src/ChangeLog
--- a/src/ChangeLog Wed Oct 29 04:02:05 2008 +0900
+++ b/src/ChangeLog Sat Nov 01 23:32:53 2008 +0900
@@ -1,3 +1,8 @@ 2008-10-25 Stephen J. Turnbull <stephe
+2008-11-01 Stephen J. Turnbull <stephen(a)xemacs.org>
+
+ * mule-ccl.c (ccl_driver): Fix off-by-one error.
+ By Julian Bradfield in <18691.16568.526264.972026(a)krk.inf.ed.ac.uk>.
+
2008-10-25 Stephen J. Turnbull <stephen(a)xemacs.org>
* lisp.h (static_pro): Cast out a warning.
diff -r 03ba50f7ecd7fb0dee997f30f1f1b7af746c7493 -r
d64f1060cd6503ad009f196304b241f940a0fe23 src/mule-ccl.c
--- a/src/mule-ccl.c Wed Oct 29 04:02:05 2008 +0900
+++ b/src/mule-ccl.c Sat Nov 01 23:32:53 2008 +0900
@@ -1455,7 +1455,7 @@ ccl_driver (struct ccl_program *ccl,
if (XCHARSET_DIMENSION (charset_by_leading_byte (i)) == 1)
i = (((i - FIELD2_TO_OFFICIAL_LEADING_BYTE) << 7)
| (reg[rrr] & 0x7F));
- else if (i < MAX_LEADING_BYTE_OFFICIAL_2)
+ else if (i <= MAX_LEADING_BYTE_OFFICIAL_2)
i = ((i - FIELD1_TO_OFFICIAL_LEADING_BYTE) << 14)
| reg[rrr];
else
diff -r 03ba50f7ecd7fb0dee997f30f1f1b7af746c7493 -r
d64f1060cd6503ad009f196304b241f940a0fe23 src/text.c
--- a/src/text.c Wed Oct 29 04:02:05 2008 +0900
+++ b/src/text.c Sat Nov 01 23:32:53 2008 +0900
@@ -3018,7 +3018,7 @@ bytebpos_to_charbpos_func (struct buffer
int record = x - best_below_byte > 5000;
#ifdef OLD_LOOP /* old code */
- while (best_below_byte < x)
+ (best_below_byte < x)
{
best_below++;
INC_BYTEBPOS (buf, best_below_byte);
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://calypso.tux.org/cgi-bin/mailman/listinfo/xemacs-patches