From: Steven Barth Date: Tue, 22 Apr 2008 18:55:12 +0000 (+0000) Subject: * ffluci.cbi: Fixed a problem where an error message occured when the first UCI secti... X-Git-Tag: 0.8.0~1111 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=32274f49f0aeb0d424a59d8cba6b20689c43ac92;p=oweals%2Fluci.git * ffluci.cbi: Fixed a problem where an error message occured when the first UCI section in an empty configuration file gets created --- diff --git a/core/src/ffluci/cbi.lua b/core/src/ffluci/cbi.lua index 5b38d1b50..f653e457d 100644 --- a/core/src/ffluci/cbi.lua +++ b/core/src/ffluci/cbi.lua @@ -147,6 +147,7 @@ function Map.add(self, sectiontype) if name then self.ucidata[name] = {} self.ucidata[name][".type"] = sectiontype + self.ucidata[".order"] = self.ucidata[".order"] or {} table.insert(self.ucidata[".order"], name) end return name @@ -164,6 +165,7 @@ function Map.set(self, section, option, value) self.ucidata[section] = {} end self.ucidata[section][".type"] = val + self.ucidata[".order"] = self.ucidata[".order"] or {} table.insert(self.ucidata[".order"], section) end end