toke.c: Set locale for all scan_num() calls; restore instead of reset
authorKarl Williamson <public@khwilliamson.com>
Thu, 12 Dec 2013 06:15:25 +0000 (23:15 -0700)
committerKarl Williamson <public@khwilliamson.com>
Sat, 4 Jan 2014 20:33:06 +0000 (13:33 -0700)
commitf6dde82eadcc6685581969cf33932bba37fed9d1
tree63a7aed7570e54c21f23a8e7d02fadd8bc44d3f7
parent90d6b40e1850c1b0849446bc02c3ffe9a376aaee
toke.c: Set locale for all scan_num() calls; restore instead of reset

One call of Perl_scan_num changes the locale around it.  However, this
function is called in several places, including from outside the file.
It is better to set the locale within scan_num() at the point where
it matters.  And, instead of setting the locale unconditionally, it is
better to change it only if it needs to be changed, and restore it to
the original.  Otherwise the locale can be changed to something
unexpected.
toke.c