mirror of
https://github.com/postgres/postgres.git
synced 2025-11-16 15:02:33 +03:00
Change mbbisearch to return the character range
Add a width field to mbinterval and have mbbisearch return a pointer to the found range rather than just bool for success. A future commit will add another width besides zero, and this will allow that to use the same search. Reviewed by Jacob Champion Discussion: https://www.postgresql.org/message-id/CAFBsxsGOCpzV7c-f3a8ADsA1n4uZ%3D8puCctQp%2Bx7W0vgkv%3Dw%2Bg%40mail.gmail.com
This commit is contained in:
@@ -17,7 +17,7 @@ my $count = 0;
|
||||
print
|
||||
"/* generated by src/common/unicode/generate-unicode_width_table.pl, do not edit */\n\n";
|
||||
|
||||
print "static const struct mbinterval combining[] = {\n";
|
||||
print "static const struct mbinterval wcwidth[] = {\n";
|
||||
|
||||
foreach my $line (<ARGV>)
|
||||
{
|
||||
@@ -40,7 +40,7 @@ foreach my $line (<ARGV>)
|
||||
# not a combining character, print out previous range if any
|
||||
if (defined($range_start))
|
||||
{
|
||||
printf "\t{0x%04X, 0x%04X},\n", $range_start, $prev_codepoint;
|
||||
printf "\t{0x%04X, 0x%04X, 0},\n", $range_start, $prev_codepoint;
|
||||
$range_start = undef;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user