From 32274f49f0aeb0d424a59d8cba6b20689c43ac92 Mon Sep 17 00:00:00 2001 From: Steven Barth Date: Tue, 22 Apr 2008 18:55:12 +0000 Subject: [PATCH] * ffluci.cbi: Fixed a problem where an error message occured when the first UCI section in an empty configuration file gets created --- core/src/ffluci/cbi.lua | 2 ++ 1 file changed, 2 insertions(+) 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 -- 2.25.1