summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarl Williamson <khw@cpan.org>2018-08-15 15:18:06 -0600
committerKarl Williamson <khw@cpan.org>2018-08-20 09:50:29 -0600
commit7e659d181665d5c61b402279e99da3381e2af78e (patch)
tree0bc426eeb491b87db069581181c512696581e577
parent9d890beed61e079102335ef5859d652b4e2c32ac (diff)
downloadperl-7e659d181665d5c61b402279e99da3381e2af78e.tar.gz
mktables: Handle platforms with 3 digit exponents
C99 says there shouldn't be more than 2 digits in an exponent unless needed. But Windows uses three. This messes some stuff up that is expecting two. Change to remove leading zeros so that only two digits are used. This allows mktables to properly operate on Windows.
-rw-r--r--charclass_invlists.h2
-rw-r--r--lib/unicore/mktables5
-rw-r--r--regcharclass.h2
-rw-r--r--uni_keywords.h2
4 files changed, 8 insertions, 3 deletions
diff --git a/charclass_invlists.h b/charclass_invlists.h
index 9965fbee31..d77a74bbcd 100644
--- a/charclass_invlists.h
+++ b/charclass_invlists.h
@@ -383417,7 +383417,7 @@ static const U8 WB_table[23][23] = {
* 018e20fa2f469667cc7ccd8a3d4a4a8cce8ad9bdf5fce5b2f61137660ea1065f lib/unicore/extracted/DLineBreak.txt
* 88c30a794011f5e6dc62154342e8bab1bd4ce2d0c0ab06fb69ba47134dc75b23 lib/unicore/extracted/DNumType.txt
* dab1e84f48990e30635a4f489d33212b25d0e35d80839c08e33a8afe5736346c lib/unicore/extracted/DNumValues.txt
- * 63f4f8e66cba85b3b52bc4a37548c2efa300549222039a43756318114e8038c3 lib/unicore/mktables
+ * aa29d36570237ec49c1fbd59d9cfafefcce690a286d3273ff4da49da1dfc88f2 lib/unicore/mktables
* 7bd6bcbe3813e0cd55e0998053d182b7bc8c97dcfd0b85028e9f7f55af4ad61b lib/unicore/version
* 4bb677187a1a64e39d48f2e341b5ecb6c99857e49d7a79cf503bd8a3c709999b regen/charset_translations.pl
* 03e51b0f07beebd5da62ab943899aa4934eee1f792fa27c1fb638c33bf4ac6ea regen/mk_PL_charclass.pl
diff --git a/lib/unicore/mktables b/lib/unicore/mktables
index 38f5c9fa3e..da5a919f8e 100644
--- a/lib/unicore/mktables
+++ b/lib/unicore/mktables
@@ -12968,6 +12968,11 @@ sub register_fraction($) {
my $float = eval $rational;
$float = sprintf "%.*e", $E_FLOAT_PRECISION, $float;
+
+ # Strip off any leading zeros beyond 2 digits to make it C99 compliant.
+ # (Windows has 3 digit exponents, contrary to C99)
+ $float =~ s/ ( .* e [-+] ) 0* ( \d{2,}? ) /$1$2/x;
+
if ( defined $nv_floating_to_rational{$float}
&& $nv_floating_to_rational{$float} ne $rational)
{
diff --git a/regcharclass.h b/regcharclass.h
index 5240fdca4f..f67e86dd0f 100644
--- a/regcharclass.h
+++ b/regcharclass.h
@@ -1909,7 +1909,7 @@
* 018e20fa2f469667cc7ccd8a3d4a4a8cce8ad9bdf5fce5b2f61137660ea1065f lib/unicore/extracted/DLineBreak.txt
* 88c30a794011f5e6dc62154342e8bab1bd4ce2d0c0ab06fb69ba47134dc75b23 lib/unicore/extracted/DNumType.txt
* dab1e84f48990e30635a4f489d33212b25d0e35d80839c08e33a8afe5736346c lib/unicore/extracted/DNumValues.txt
- * 63f4f8e66cba85b3b52bc4a37548c2efa300549222039a43756318114e8038c3 lib/unicore/mktables
+ * aa29d36570237ec49c1fbd59d9cfafefcce690a286d3273ff4da49da1dfc88f2 lib/unicore/mktables
* 7bd6bcbe3813e0cd55e0998053d182b7bc8c97dcfd0b85028e9f7f55af4ad61b lib/unicore/version
* 4bb677187a1a64e39d48f2e341b5ecb6c99857e49d7a79cf503bd8a3c709999b regen/charset_translations.pl
* f4fe24c2a005b636f6e7418df060c6c9a57ddcae4219b54d0cb18baf312dbc3a regen/regcharclass.pl
diff --git a/uni_keywords.h b/uni_keywords.h
index 61aa62ca8f..8c5125b430 100644
--- a/uni_keywords.h
+++ b/uni_keywords.h
@@ -6990,7 +6990,7 @@ MPH_VALt match_uniprop( const unsigned char * const key, const U16 key_len ) {
* 018e20fa2f469667cc7ccd8a3d4a4a8cce8ad9bdf5fce5b2f61137660ea1065f lib/unicore/extracted/DLineBreak.txt
* 88c30a794011f5e6dc62154342e8bab1bd4ce2d0c0ab06fb69ba47134dc75b23 lib/unicore/extracted/DNumType.txt
* dab1e84f48990e30635a4f489d33212b25d0e35d80839c08e33a8afe5736346c lib/unicore/extracted/DNumValues.txt
- * 63f4f8e66cba85b3b52bc4a37548c2efa300549222039a43756318114e8038c3 lib/unicore/mktables
+ * aa29d36570237ec49c1fbd59d9cfafefcce690a286d3273ff4da49da1dfc88f2 lib/unicore/mktables
* 7bd6bcbe3813e0cd55e0998053d182b7bc8c97dcfd0b85028e9f7f55af4ad61b lib/unicore/version
* 4bb677187a1a64e39d48f2e341b5ecb6c99857e49d7a79cf503bd8a3c709999b regen/charset_translations.pl
* 03e51b0f07beebd5da62ab943899aa4934eee1f792fa27c1fb638c33bf4ac6ea regen/mk_PL_charclass.pl