Locale-independent parsing of floats in trader queries

Review Request #101610 - Created June 13, 2011 and submitted

Information
Chusslove Illich
kdelibs
master
275548
Reviewers
kdelibs
Usage of atof() to parse floats in trader language was locale-dependent:
if locale specified something other than dot as decimal separator,
parsing floats (which are always dot-separated in queries) failed.
Replaced atof() with simple sufficient custom parser.

Added a unit test.
Unit test.

In bug #275548 a plugin could not be loaded in some locales because,
as it turned out, it failed version check due to misparsed floats
in a trader query. This fix makes it load properly.
Chusslove Illich
Nicolás Alvarez
Chusslove Illich
Review request changed

Change Summary:

(Slightly updated to apply to current code.)

This patch seems to work well so far, I will commit it soon to 4.7 and
frameworks if there are no objections. (And run regen.sh to update lex.c and
others.)

Diff:

Revision 3 (+52 -1)

Show changes

Loading...