destroy = del;
}
-XMLBuffer::XMLBuffer(long buf_size, const char *buf, int del)
+XMLBuffer::XMLBuffer(long buf_size, char *buf, int del)
{ // writing
bfr = (unsigned char *)buf;
bsz = buf_size;
if( destroy ) delete [] bfr;
}
-unsigned char *&XMLBuffer::demand(long len)
+int XMLBuffer::demand(long len)
{
if( len > bsz ) {
+ if( !destroy ) return 0;
long sz = inp-bfr;
len += sz/2 + BCTEXTLEN;
unsigned char *np = new unsigned char[len];
lmt = np + len; bsz = len;
delete [] bfr; bfr = np;
}
- return bfr;
+ return 1;
}
int XMLBuffer::write(const char *bp, int len)
{
- if( !destroy && lmt-inp < len ) len = lmt-inp;
if( len <= 0 ) return 0;
+ if( !destroy && lmt-inp < len ) len = lmt-inp;
demand(otell()+len);
memmove(inp,bp,len);
inp += len;
else
term = ' ';
value_start = buf->itell()-1;
- while( ch >= 0 && (ch!=term && ch!=right_delm && ch!='\n') )
+ while( ch >= 0 ) {
+// old edl bug work-around, allow nl in quoted string
+ if( ch==term || ch==right_delm ) break;
+ if( ch=='\n' && term!='\"' ) break;
ch = buf->next();
+ }
if( ch < 0 ) EOB_RETURN();
value_end = buf->itell()-1;
// add property
++pos;
}
// if end tag is reached, pos is left on the < of the end tag
- if( !skip && pos >= 0 && !tag_end[pos] && !skip )
+ if( !skip && pos >= 0 && !tag_end[pos] )
buffer->iseek(ipos);
return opos;
}