$NetBSD: patch-am,v 1.1 2006/08/14 22:40:53 wiz Exp $ --- share/ioncorelib.lua.orig 2004-02-16 17:58:47.000000000 +0000 +++ share/ioncorelib.lua @@ -9,10 +9,10 @@ -- (at your option) any later version. -- --- This is a slight abuse of the _LOADED variable perhaps, but library-like +-- This is a slight abuse of the package.loaded variable perhaps, but library-like -- packages should handle checking if they're loaded instead of confusing -- the user with require/include differences. -if _LOADED["ioncorelib"] then return end +if package.loaded["ioncorelib"] then return end -- Constants {{{ @@ -162,9 +162,9 @@ local winprops={} local function alternative_winprop_idents(id) local function g() - for _, c in {id.class, "*"} do - for _, r in {id.role, "*"} do - for _, i in {id.instance, "*"} do + for _, c in pairs({id.class, "*"}) do + for _, r in pairs({id.role, "*"}) do + for _, i in pairs({id.instance, "*"}) do coroutine.yield(c, r, i) end end @@ -183,7 +183,7 @@ function get_winprop(cwin) names={} pcall(function() names=winprops[c][r][i] or {} end) local match, matchl=names[0], 0 - for name, prop in names do + for name, prop in pairs(names) do if type(name)=="string" then local st, en=string.find(nm, name) if st and en then @@ -223,7 +223,7 @@ end function winprop(list) local list2, class, role, instance, name = {}, "*", "*", "*", 0 - for k, v in list do + for k, v in pairs(list) do if k == "class" then class = v elseif k == "role" then @@ -328,5 +328,5 @@ end -- Mark ourselves loaded. -_LOADED["ioncorelib"]=true +package.loaded["ioncorelib"]=true