Review Request: Locale-independent parsing of floats in trader queries

Chusslove Illich caslav.ilic at
Sun Aug 14 10:43:52 BST 2011

This is an automatically generated e-mail. To reply, visit:

(Updated Aug. 14, 2011, 9:43 a.m.)

Review request for kdelibs.


(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 to update lex.c and


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.

This addresses bug 275548.

Diffs (updated)

  kdecore/services/lex.l b00013b 
  kdecore/tests/kservicetest.h 189bbd4 
  kdecore/tests/kservicetest.cpp 4151177 



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.



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the kde-core-devel mailing list