diff --git a/LIP.lua b/LIP.lua index aecdb14..2d23e65 100644 --- a/LIP.lua +++ b/LIP.lua @@ -34,12 +34,12 @@ function LIP.load(fileName) local data = {}; local section; for line in file:lines() do - local tempSection = line:match('^%[([^%[%]]+)%]$'); + local tempSection = line:match('^%[([^%[%]]+)%][\r]?$'); if(tempSection)then section = tonumber(tempSection) and tonumber(tempSection) or tempSection; data[section] = data[section] or {}; end - local param, value = line:match('^([%w|_]+)%s-=%s-(.+)$'); + local param, value = line:match('^([%w|_]+)%s-=%s-(.+)[\r]?$'); if(param and value ~= nil)then if(tonumber(value))then value = tonumber(value); @@ -77,4 +77,4 @@ function LIP.save(fileName, data) file:close(); end -return LIP; \ No newline at end of file +return LIP;