diff --git a/LIP.lua b/LIP.lua index aecdb14..f84f85d 100644 --- a/LIP.lua +++ b/LIP.lua @@ -39,8 +39,9 @@ function LIP.load(fileName) 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 + value = value:match('^(.-)%s-;.-$') or value:match('^(.-)%s-$'); if(tonumber(value))then value = tonumber(value); elseif(value == 'true')then @@ -77,4 +78,4 @@ function LIP.save(fileName, data) file:close(); end -return LIP; \ No newline at end of file +return LIP;