* ffluci.cbi: Fixed a problem where an error message occured when the first UCI section in an empty configuration file gets created

This commit is contained in:
Steven Barth 2008-04-22 18:55:12 +00:00
parent b08db70e90
commit 32274f49f0

View file

@ -147,6 +147,7 @@ function Map.add(self, sectiontype)
if name then if name then
self.ucidata[name] = {} self.ucidata[name] = {}
self.ucidata[name][".type"] = sectiontype self.ucidata[name][".type"] = sectiontype
self.ucidata[".order"] = self.ucidata[".order"] or {}
table.insert(self.ucidata[".order"], name) table.insert(self.ucidata[".order"], name)
end end
return name return name
@ -164,6 +165,7 @@ function Map.set(self, section, option, value)
self.ucidata[section] = {} self.ucidata[section] = {}
end end
self.ucidata[section][".type"] = val self.ucidata[section][".type"] = val
self.ucidata[".order"] = self.ucidata[".order"] or {}
table.insert(self.ucidata[".order"], section) table.insert(self.ucidata[".order"], section)
end end
end end