fix locale problem (decimal separator isn't dot but comma)

If user changes locale with os.setlocale to a "dirty"
locale (which use comma as decimal separator (not dot), e.g.
hu_HU) `tonumber` will produce "0,6" instead of "0.6"
which causes bad comparision.

Signed-off-by: uzsolt <udvzsolt@gmail.com>
Signed-off-by: Uli Schlachter <psychon@znc.in>
This commit is contained in:
uzsolt 2013-01-02 12:13:45 +01:00 committed by Uli Schlachter
parent 02ea5f9b23
commit 23fe017bd4
1 changed files with 2 additions and 1 deletions

View File

@ -11,7 +11,8 @@ local cairo = require("lgi").cairo
-- This checks for '<= 0.5' because there are git versions after 0.6 which still
-- identify themselves as 0.6 but already have the needed cairo support
if tonumber(string.match(require('lgi.version'), '(%d%.%d)')) <= 0.5 then
local ver_major,ver_minor = string.match(require('lgi.version'),'(%d)%.(%d)')
if ( (tonumber(ver_major)<=0) and (tonumber(ver_minor)<=5) ) then
error("lgi too old, need at least version 0.6.1")
end