Comparison

util/vcard.lua @ 317:38562b0b50f2

util.vcard: Don't break on data outside of VCARD sections (thanks moo-min)
author Kim Alvefur <zash@zash.se>
date Mon, 17 Dec 2012 12:47:25 +0100
parent 311:de6e59e751eb
child 490:6b2f31da9610
comparison
equal deleted inserted replaced
316:03ad51d96858 317:38562b0b50f2
140 if name == "BEGIN" and value == "VCARD" then 140 if name == "BEGIN" and value == "VCARD" then
141 c = {}; 141 c = {};
142 vCards[#vCards+1] = c; 142 vCards[#vCards+1] = c;
143 elseif name == "END" and value == "VCARD" then 143 elseif name == "END" and value == "VCARD" then
144 c = nil; 144 c = nil;
145 elseif vCard_dtd[name] then 145 elseif c and vCard_dtd[name] then
146 local dtd = vCard_dtd[name]; 146 local dtd = vCard_dtd[name];
147 local p = { name = name }; 147 local p = { name = name };
148 c[#c+1]=p; 148 c[#c+1]=p;
149 --c[name]=p; 149 --c[name]=p;
150 local up = c; 150 local up = c;