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:
@@ -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()
|
||||||
|
|||||||
Reference in New Issue
Block a user