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:
parent
02ea5f9b23
commit
23fe017bd4
|
@ -11,7 +11,8 @@ local cairo = require("lgi").cairo
|
||||||
|
|
||||||
-- This checks for '<= 0.5' because there are git versions after 0.6 which still
|
-- 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
|
-- 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")
|
error("lgi too old, need at least version 0.6.1")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue