From: Karl Williamson Date: Mon, 5 Sep 2011 04:12:11 +0000 (-0600) Subject: mktables: output floating pt as strings X-Git-Tag: accepted/trunk/20130322.191538~2193^2~92 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=02cc66567a9d64714c1f97ec260d2d076498fe53;p=platform%2Fupstream%2Fperl.git mktables: output floating pt as strings mktables creates data structures on files that are later read in. Some of these are nominally floating point numbers, like 2.0. But they are actually version numbers, and if output without being quoted, they will be read in as just an integer and a string compare will fail. Actual floating point numbers are also output, but if these are output enclosed in quotes, they will be coerced into the correct data type when necessary. This fix doesn't correct any known existing problems, but is needed for future commits. --- diff --git a/lib/unicore/mktables b/lib/unicore/mktables index ef8716a..2831436 100644 --- a/lib/unicore/mktables +++ b/lib/unicore/mktables @@ -8330,9 +8330,8 @@ sub utf8_heavy_name ($$) { my $copy = $item; $copy = $UNDEF unless defined $copy; - # Quote non-numbers (numbers also have optional leading '-' and - # fractions) - if ($copy eq "" || $copy !~ /^ -? \d+ ( \. \d+ )? $/x) { + # Quote non-integers (integers also have optional leading '-') + if ($copy eq "" || $copy !~ /^ -? \d+ $/x) { # Escape apostrophe and backslash $copy =~ s/ ( ['\\] ) /\\$1/xg;