Software /
code /
prosody
Diff
util/stanza.lua @ 2734:7941617b15f9
util.stanza: Fixed nil global accesses.
author | Waqas Hussain <waqas20@gmail.com> |
---|---|
date | Tue, 02 Mar 2010 00:50:54 +0500 |
parent | 2557:e5254ccd5ef8 |
child | 2925:692b3c6c5bd2 |
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