Software /
code /
prosody
Changeset
2956:15a145a67044
util.stanza: Fixed some more nil global accesses.
author | Waqas Hussain <waqas20@gmail.com> |
---|---|
date | Thu, 01 Apr 2010 19:12:08 +0500 |
parents | 2955:f807dc244a5b |
children | 2957:805b067cd13e |
files | util/stanza.lua |
diffstat | 1 files changed, 3 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/util/stanza.lua Thu Apr 01 19:08:25 2010 +0500 +++ b/util/stanza.lua Thu Apr 01 19:12:08 2010 +0500 @@ -225,14 +225,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