# HG changeset patch # User Stephen J. Turnbull # Date 1225549973 -32400 # Node ID d64f1060cd6503ad009f196304b241f940a0fe23 # Parent 03ba50f7ecd7fb0dee997f30f1f1b7af746c7493 Fix off-by-one error in ccl_driver. <87iqr7v7p0.fsf@uwakimon.sk.tsukuba.ac.jp> diff -r 03ba50f7ecd7 -r d64f1060cd65 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-11-01 Stephen J. Turnbull + + * mule-ccl.c (ccl_driver): Fix off-by-one error. + By Julian Bradfield in <18691.16568.526264.972026@krk.inf.ed.ac.uk>. + 2008-10-25 Stephen J. Turnbull * lisp.h (static_pro): Cast out a warning. diff -r 03ba50f7ecd7 -r d64f1060cd65 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 @@ 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 03ba50f7ecd7 -r d64f1060cd65 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 @@ 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);