From: James Clark Date: Wed, 10 Dec 1997 07:57:10 +0000 (+0000) Subject: Don't need to check system identifiers X-Git-Tag: REC1_0~49 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8b6b5840ee63e7bfd57a04d30d3ced7aa621f332;p=libexpat Don't need to check system identifiers --- diff --git a/expat/xmltok/xmltok.c b/expat/xmltok/xmltok.c index 8f89da35..01e441e3 100755 --- a/expat/xmltok/xmltok.c +++ b/expat/xmltok/xmltok.c @@ -10,8 +10,7 @@ PREFIX(getAtts), \ PREFIX(charRefNumber), \ PREFIX(updatePosition), \ - PREFIX(isPublicId), \ - PREFIX(isSystemId) + PREFIX(isPublicId) #define VTABLE2 \ PREFIX(encode), \ diff --git a/expat/xmltok/xmltok.h b/expat/xmltok/xmltok.h index 3608a2a8..0634b4dd 100755 --- a/expat/xmltok/xmltok.h +++ b/expat/xmltok/xmltok.h @@ -121,8 +121,6 @@ struct encoding { POSITION *); int (*isPublicId)(const ENCODING *enc, const char *ptr, const char *end, const char **badPtr); - int (*isSystemId)(const ENCODING *enc, const char *ptr, const char *end, - const char **badPtr); int (*encode)(const ENCODING *enc, int charNum, char *buf); @@ -196,9 +194,6 @@ the content of a literal that has already been returned by XmlTok. */ #define XmlIsPublicId(enc, ptr, end, badPtr) \ (((enc)->isPublicId)(enc, ptr, end, badPtr)) -#define XmlIsSystemId(enc, ptr, end, badPtr) \ - (((enc)->isSystemId)(enc, ptr, end, badPtr)) - #define XmlEncode(enc, ch, buf) \ (((enc)->encode)(enc, ch, buf)) diff --git a/expat/xmltok/xmltok_impl.c b/expat/xmltok/xmltok_impl.c index 618aa67a..e46b1e7d 100755 --- a/expat/xmltok/xmltok_impl.c +++ b/expat/xmltok/xmltok_impl.c @@ -1116,53 +1116,6 @@ int PREFIX(isPublicId)(const ENCODING *enc, const char *ptr, const char *end, return 1; } -static -int PREFIX(isSystemId)(const ENCODING *enc, const char *ptr, const char *end, - const char **badPtr) -{ - ptr += MINBPC; - end -= MINBPC; - for (; ptr != end; ptr += MINBPC) { - switch (BYTE_TYPE(enc, ptr)) { - case BT_DIGIT: - case BT_HEX: - case BT_MINUS: - case BT_APOS: - case BT_LPAR: - case BT_RPAR: - case BT_PLUS: - case BT_COMMA: - case BT_SOL: - case BT_AMP: - case BT_SEMI: - case BT_EQUALS: - case BT_QUEST: - case BT_EXCL: - case BT_AST: - case BT_PERCNT: - break; - case BT_NAME: - case BT_NMSTRT: - if (BYTE_TO_ASCII(enc, ptr) & ~0x7f) { - *badPtr = ptr; - return 0; - } - break; - default: - switch (BYTE_TO_ASCII(enc, ptr)) { - case '@': - case '$': - break; - default: - *badPtr = ptr; - return 0; - } - break; - } - } - return 1; -} - /* This must only be called for a well-formed start-tag or empty element tag. Returns the number of attributes. Pointers to the first attsMax attributes are stored in atts. */ diff --git a/expat/xmlwf/wfcheck.c b/expat/xmlwf/wfcheck.c index c80dd010..6d25313d 100755 --- a/expat/xmlwf/wfcheck.c +++ b/expat/xmlwf/wfcheck.c @@ -438,14 +438,8 @@ checkProlog(DTD *dtd, const char *s, const char *end, break; } case XML_ROLE_DOCTYPE_SYSTEM_ID: - if (!XmlIsSystemId(*enc, s, next, nextPtr)) - return syntaxError; dtd->containsRef = 1; break; - case XML_ROLE_NOTATION_SYSTEM_ID: - if (!XmlIsSystemId(*enc, s, next, nextPtr)) - return syntaxError; - break; case XML_ROLE_DOCTYPE_PUBLIC_ID: case XML_ROLE_ENTITY_PUBLIC_ID: case XML_ROLE_NOTATION_PUBLIC_ID: @@ -485,8 +479,6 @@ checkProlog(DTD *dtd, const char *s, const char *end, } break; case XML_ROLE_ENTITY_SYSTEM_ID: - if (!XmlIsSystemId(*enc, s, next, nextPtr)) - return syntaxError; if (entityNamePtr) { const char *name = poolStoreString(&dtd->pool, *enc, entityNamePtr, entityNameEnd); entity = (ENTITY *)lookup(&dtd->generalEntities, name, sizeof(ENTITY));