Fixed UVL
authorSteven Barth <steven@midlink.org>
Mon, 8 Sep 2008 18:34:26 +0000 (18:34 +0000)
committerSteven Barth <steven@midlink.org>
Mon, 8 Sep 2008 18:34:26 +0000 (18:34 +0000)
libs/uvl/luasrc/uvl.lua

index 98d0d59f53b61650e597d004909ff342e55c9762..acbdccde68d5f9c7b56a32429a2dc0da813cfaa5 100644 (file)
@@ -835,12 +835,12 @@ function uvlitem.scheme(self, opt)
        local s = self._scheme
 
        if not s then
-               s = self.s and self.s.packages and s[self.sref[1]]
-               if #self.sref > 1 then
-                       s = s and s.sections and s[self.sref[2]]
-               end
-               if #self.sref > 2 then
-                       s = s and s[self.sref[2]] and s[self.sref[3]]
+               s = self.s and self.s.packages and self.s.packages[self.sref[1]]
+               if #self.sref == 2 then
+                       s = s and s.sections and s.sections[self.sref[2]]
+               elseif #self.sref > 2 then
+                       s = s and s.variables and s.variables[self.sref[2]]
+                               and s.variables[self.sref[2]][self.sref[3]]
                end
                self._scheme = s
        end