_fallback: INI sections must start with brackets (#2127)
Previously, IniFile.ReadFile created sections by checking for brackets anywhere in the line, causing issues if a value had brackets. This commit changes the section matching regex, so that only lines that begin with a bracket can become sections.
This commit is contained in:
@@ -80,7 +80,7 @@ IniFile =
|
|||||||
--ignore comments.
|
--ignore comments.
|
||||||
if not str:find("^%s*#") then
|
if not str:find("^%s*#") then
|
||||||
-- is this a section?
|
-- is this a section?
|
||||||
local sec = str:match( "%[(.+)%]" )
|
local sec = str:match( "^%[(.+)%]" )
|
||||||
|
|
||||||
-- if so, set focus there; otherwise, try to
|
-- if so, set focus there; otherwise, try to
|
||||||
-- read a key/value pair (ignore blank lines)
|
-- read a key/value pair (ignore blank lines)
|
||||||
|
|||||||
Reference in New Issue
Block a user