Lines 259-264
Link Here
|
259 |
} |
259 |
} |
260 |
|
260 |
|
261 |
|
261 |
|
|
|
262 |
#ifndef XML_VERSION_AT_LEAST |
263 |
#define XML_VERSION_AT_LEAST(major,minor,patch) \ |
264 |
(((major) < XML_MAJOR_VERSION) \ |
265 |
|| ((major) == XML_MAJOR_VERSION && (minor) < XML_MINOR_VERSION) \ |
266 |
|| ((major) == XML_MAJOR_VERSION && (minor) == XML_MINOR_VERSION && \ |
267 |
(patch) <= XML_MICRO_VERSION)) |
268 |
#endif /* XML_VERSION_AT_LEAST */ |
269 |
|
262 |
const char * |
270 |
const char * |
263 |
svn_xml_fuzzy_escape(const char *string, apr_pool_t *pool) |
271 |
svn_xml_fuzzy_escape(const char *string, apr_pool_t *pool) |
264 |
{ |
272 |
{ |
Lines 338-343
Link Here
|
338 |
(*svn_parser->data_handler)(svn_parser->baton, s, (apr_size_t)len); |
346 |
(*svn_parser->data_handler)(svn_parser->baton, s, (apr_size_t)len); |
339 |
} |
347 |
} |
340 |
|
348 |
|
|
|
349 |
#if XML_VERSION_AT_LEAST(1, 95, 8) |
350 |
static void expat_entity_declaration(void *userData, |
351 |
const XML_Char *entityName, |
352 |
int is_parameter_entity, |
353 |
const XML_Char *value, |
354 |
int value_length, |
355 |
const XML_Char *base, |
356 |
const XML_Char *systemId, |
357 |
const XML_Char *publicId, |
358 |
const XML_Char *notationName) |
359 |
{ |
360 |
svn_xml_parser_t *svn_parser = userData; |
361 |
|
362 |
/* Stop the parser if an entity declaration is hit. */ |
363 |
XML_StopParser(svn_parser->parser, 0 /* resumable */); |
364 |
} |
365 |
#else |
366 |
/* A noop default_handler. */ |
367 |
static void expat_default_handler(void *userData, const XML_Char *s, int len) |
368 |
{ |
369 |
} |
370 |
#endif |
341 |
|
371 |
|
342 |
/*** Making a parser. ***/ |
372 |
/*** Making a parser. ***/ |
343 |
|
373 |
|
Lines 359-364
Link Here
|
359 |
XML_SetCharacterDataHandler(parser, |
389 |
XML_SetCharacterDataHandler(parser, |
360 |
data_handler ? expat_data_handler : NULL); |
390 |
data_handler ? expat_data_handler : NULL); |
361 |
|
391 |
|
|
|
392 |
#if XML_VERSION_AT_LEAST(1, 95, 8) |
393 |
XML_SetEntityDeclHandler(parser, expat_entity_declaration); |
394 |
#else |
395 |
XML_SetDefaultHandler(parser, expat_default_handler); |
396 |
#endif |
397 |
|
362 |
/* ### we probably don't want this pool; or at least we should pass it |
398 |
/* ### we probably don't want this pool; or at least we should pass it |
363 |
### to the callbacks and clear it periodically. */ |
399 |
### to the callbacks and clear it periodically. */ |
364 |
subpool = svn_pool_create(pool); |
400 |
subpool = svn_pool_create(pool); |
Lines 440-445
Link Here
|
440 |
/* This will cause the current XML_Parse() call to finish quickly! */ |
476 |
/* This will cause the current XML_Parse() call to finish quickly! */ |
441 |
XML_SetElementHandler(svn_parser->parser, NULL, NULL); |
477 |
XML_SetElementHandler(svn_parser->parser, NULL, NULL); |
442 |
XML_SetCharacterDataHandler(svn_parser->parser, NULL); |
478 |
XML_SetCharacterDataHandler(svn_parser->parser, NULL); |
|
|
479 |
#if XML_VERSION_AT_LEAST(1, 95, 8) |
480 |
XML_SetEntityDeclHandler(svn_parser->parser, NULL); |
481 |
#endif |
443 |
|
482 |
|
444 |
/* Once outside of XML_Parse(), the existence of this field will |
483 |
/* Once outside of XML_Parse(), the existence of this field will |
445 |
cause svn_delta_parse()'s main read-loop to return error. */ |
484 |
cause svn_delta_parse()'s main read-loop to return error. */ |