make_unicode: Avoid duplicate lead bytes.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Alexandre Julliard 2019-10-06 13:39:53 +02:00
parent 7d954f2335
commit a9285c5131
2 changed files with 11 additions and 1498 deletions

File diff suppressed because it is too large Load Diff

View File

@ -629,6 +629,7 @@ sub READ_DEFAULTS($)
sub add_lead_byte($)
{
my $ch = shift;
return if defined $cp2uni[$ch];
push @lead_bytes, $ch;
$cp2uni[$ch] = 0;
}
@ -640,10 +641,7 @@ sub add_mapping($$)
my ($cp, $uni) = @_;
$cp2uni[$cp] = $uni unless defined($cp2uni[$cp]);
$uni2cp[$uni] = $cp unless defined($uni2cp[$uni]);
if ($cp > 0xff && !defined($cp2uni[$cp >> 8]))
{
add_lead_byte( $cp >> 8 );
}
if ($cp > 0xff) { add_lead_byte( $cp >> 8 ); }
}
################################################################