a = 0;
if(ts->mtype == TextHtml) {
for(;;) {
+ assert(ai <= alen);
if(alen - ai < ToksChunk/32) {
alen += ToksChunk;
a = erealloc(a, alen*sizeof *a);
else {
// plain text (non-html) tokens
for(;;) {
+ assert(ai <= alen);
if(alen - ai < ToksChunk/32) {
alen += ToksChunk;
a = erealloc(a, alen*sizeof *a);
memcpy(&s[i], buf, j*sizeof *s);
s[i+j] = 0;
}
+ setmalloctag(s, getcallerpc(&s));
return s;
}
Token* tok;
Rune buf[BIGBUFSIZE];
+ al = nil;
rbra = 0;
nexti = ts->i;
tok = &a[*pai];
else
tok->text = _Strndup(buf, i); // for warning print, in build
// attribute gathering loop
- al = nil;
while(1) {
// look for "ws name" or "ws name ws = ws val" (ws=whitespace)
// skip whitespace
if(warn)
fprint(2, "warning: incomplete tag at end of page\n");
backup(ts, nexti);
+ freeattrs(al);
tok->tag = Data;
tok->text = _Strdup(L"<");
return Data;
ans->attid = attid;
ans->value = value;
ans->next = link;
+ setmalloctag(ans, getcallerpc(&attid));
return ans;
}