awk: 00.123 is not a octal constant; neither is 009.123. fixing this

function                                             old     new   delta
my_strtod                                             80     113     +33

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
This commit is contained in:
Denys Vlasenko
2010-10-05 13:22:11 +02:00
parent 5b34300178
commit d527e0c81d
2 changed files with 46 additions and 8 deletions

View File

@@ -24,6 +24,12 @@ testing "awk hex const 2" "awk '{ print or(0x80000000,1) }'" "2.14748e+09\n" ""
testing "awk oct const" "awk '{ print or(01234,1) }'" "669\n" "" "\n"
SKIP=
# check that "hex/oct integer" heuristic doesn't kick in on 00NN.NNN
testing "awk floating const with leading zeroes" \
"awk '{ printf \"%f %f\n\", \"000.123\", \"009.123\" }'" \
"0.123000 9.123000\n" \
"" "\n"
# long field seps requiring regex
testing "awk long field sep" "awk -F-- '{ print NF, length(\$NF), \$NF }'" \
"2 0 \n3 0 \n4 0 \n5 0 \n" \