patch IniFile's Lua implementation to have # comment support. Could potentially be breaking, but I'm unaware of any INI files that try to use tags that start with #.

This commit is contained in:
Flameshadowxeroshin
2013-01-27 00:02:35 -06:00
parent 1bf8e07584
commit 4db3e51a03
+3
View File
@@ -65,6 +65,8 @@ IniFile =
while not file:AtEOF() do while not file:AtEOF() do
local str = file:GetLine() local str = file:GetLine()
--ignore comments.
if not str:find("^%s*#") then
-- is this a section? -- is this a section?
local _, _, sec = str:find( "%[(.+)%]" ) local _, _, sec = str:find( "%[(.+)%]" )
@@ -80,6 +82,7 @@ IniFile =
if k and v then current[k] = v end if k and v then current[k] = v end
end end
end end
end
file:Close() file:Close()
file:destroy() file:destroy()