Changeset

2734:7941617b15f9

util.stanza: Fixed nil global accesses.
author Waqas Hussain <waqas20@gmail.com>
date Tue, 02 Mar 2010 00:50:54 +0500
parents 2733:65ad0fdb17ba
children 2735:65bbc4b67733
files util/stanza.lua
diffstat 1 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/util/stanza.lua	Mon Mar 01 18:52:47 2010 +0000
+++ b/util/stanza.lua	Tue Mar 02 00:50:54 2010 +0500
@@ -247,14 +247,14 @@
 		for i=1,#attr do attr[i] = nil; end
 		local attrx = {};
 		for att in pairs(attr) do
-			if s_find(att, "|", 1, true) and not s_find(k, "\1", 1, true) then
-				local ns,na = s_match(k, "^([^|]+)|(.+)$");
+			if s_find(att, "|", 1, true) and not s_find(att, "\1", 1, true) then
+				local ns,na = s_match(att, "^([^|]+)|(.+)$");
 				attrx[ns.."\1"..na] = attr[att];
 				attr[att] = nil;
 			end
 		end
 		for a,v in pairs(attrx) do
-			attr[x] = v;
+			attr[a] = v;
 		end
 		setmetatable(stanza, stanza_mt);
 		for _, child in ipairs(stanza) do