[Expat-bugs] [ expat-Bugs-1023646 ] Error in codepageMap, codepage.c

SourceForge.net noreply at sourceforge.net
Mon Mar 6 15:51:06 CET 2006


Bugs item #1023646, was opened at 2004-09-07 08:39
Message generated for change (Comment added) made by kwaclaw
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=110127&aid=1023646&group_id=10127

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: None
Group: Platform Specific
>Status: Closed
Resolution: Fixed
Priority: 5
Submitted By: Nobody/Anonymous (nobody)
Assigned to: Fred L. Drake, Jr. (fdrake)
Summary: Error in codepageMap, codepage.c

Initial Comment:
Applies to expat v.1.95.8

>From MS:

"LeadByte:
Specifies a fixed-length array of lead-byte ranges, 
where the number of lead-byte ranges is variable. If 
there are no lead bytes in this code page, then every 
element of the array is NULL. If there are lead bytes in 
this code page, a starting value and ending value is 
specified for each range. Ranges are inclusive. The 
maximum number of lead-byte ranges for any code page 
is five. The array uses two bytes to describe each 
range, with a double-byte null terminator after the last 
range."

Note that "Ranges are inclusive". Therefore the function 
codepageMap should be changed:

for (i = 0; i < MAX_LEADBYTES; i+=2) 
{
  int j, lim;
  if (info.LeadByte[i] == 0 && info.LeadByte[i + 1] == 0) 
    break;
  lim = info.LeadByte[i + 1];
  for (j = info.LeadByte[i]; j <= lim; j++) map[j] = -2;
}

Regards,
Ole Stauning, spam at uning.dk


----------------------------------------------------------------------

>Comment By: Karl Waclawek (kwaclaw)
Date: 2006-03-06 09:51

Message:
Logged In: YES 
user_id=290026

No test cases were built, but since there were no complaints
for a long time, we close this issue.

----------------------------------------------------------------------

Comment By: Karl Waclawek (kwaclaw)
Date: 2005-04-19 14:26

Message:
Logged In: YES 
user_id=290026

Forget my question, I went ahead and committed it.
See codepage.c rev. 1.12.
Assigned to Fred for testing.

----------------------------------------------------------------------

Comment By: Karl Waclawek (kwaclaw)
Date: 2005-04-19 13:56

Message:
Logged In: YES 
user_id=290026

To Fred: Has this been committed yet?

----------------------------------------------------------------------

Comment By: Fred L. Drake, Jr. (fdrake)
Date: 2005-01-27 10:17

Message:
Logged In: YES 
user_id=3066

Then I think this is ok to commit if everything continues to
work for you on Windows.  I'll email the original poster
since it doesn't look like SF will be sending him updates
automatically.

----------------------------------------------------------------------

Comment By: Karl Waclawek (kwaclaw)
Date: 2005-01-27 09:46

Message:
Logged In: YES 
user_id=290026

FWIW, I agree with the above conclusions as well.

----------------------------------------------------------------------

Comment By: Fred L. Drake, Jr. (fdrake)
Date: 2005-01-27 00:44

Message:
Logged In: YES 
user_id=3066

I'm inclined to agree, having read the CPINFO 
documentation.  Do you have a test case that breaks using 
the current code, and which your proposed change would 
fix? 

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=110127&aid=1023646&group_id=10127


More information about the Expat-bugs mailing list