Commit 76e95df0 authored by William M. Brack's avatar William M. Brack

Changed all (?) occurences where validation macros (IS_xxx) had

* include/libxml/parserInternals.h HTMLparser.c HTMLtree.c
  SAX2.c catalog.c debugXML.c entities.c parser.c relaxng.c
  testSAX.c tree.c valid.c xmlschemas.c xmlschemastypes.c
  xpath.c: Changed all (?) occurences where validation macros
  (IS_xxx) had single-byte arguments to use IS_xxx_CH instead
  (e.g. IS_BLANK changed to IS_BLANK_CH).  This gets rid of
  many warning messages on certain platforms, and also high-
  lights places in the library which may need to be enhanced
  for proper UTF8 handling.
parent 196b3886
Sun Oct 19 00:15:38 HKT 2003 William Brack <wbrack@mmm.com.hk>
* include/libxml/parserInternals.h HTMLparser.c HTMLtree.c
SAX2.c catalog.c debugXML.c entities.c parser.c relaxng.c
testSAX.c tree.c valid.c xmlschemas.c xmlschemastypes.c
xpath.c: Changed all (?) occurences where validation macros
(IS_xxx) had single-byte arguments to use IS_xxx_CH instead
(e.g. IS_BLANK changed to IS_BLANK_CH). This gets rid of
many warning messages on certain platforms, and also high-
lights places in the library which may need to be enhanced
for proper UTF8 handling.
Sat Oct 18 20:34:18 HKT 2003 William Brack <wbrack@mmm.com.hk>
* genChRanges.py, chvalid.c, include/libxml/chvalid.h,
......
......@@ -408,7 +408,7 @@ static int
htmlSkipBlankChars(xmlParserCtxtPtr ctxt) {
int res = 0;
while (IS_BLANK(*(ctxt->input->cur))) {
while (IS_BLANK_CH(*(ctxt->input->cur))) {
if ((*ctxt->input->cur == 0) &&
(xmlParserInputGrow(ctxt->input, INPUT_CHUNK) <= 0)) {
xmlPopInput(ctxt);
......@@ -1999,7 +1999,7 @@ static int areBlanks(htmlParserCtxtPtr ctxt, const xmlChar *str, int len) {
xmlNodePtr lastChild;
for (j = 0;j < len;j++)
if (!(IS_BLANK(str[j]))) return(0);
if (!(IS_BLANK_CH(str[j]))) return(0);
if (CUR == 0) return(1);
if (CUR != '<') return(0);
......@@ -2131,11 +2131,11 @@ htmlParseHTMLName(htmlParserCtxtPtr ctxt) {
int i = 0;
xmlChar loc[HTML_PARSER_BUFFER_SIZE];
if (!IS_LETTER(CUR) && (CUR != '_') &&
if (!IS_LETTER_CH(CUR) && (CUR != '_') &&
(CUR != ':')) return(NULL);
while ((i < HTML_PARSER_BUFFER_SIZE) &&
((IS_LETTER(CUR)) || (IS_DIGIT(CUR)) ||
((IS_LETTER_CH(CUR)) || (IS_DIGIT_CH(CUR)) ||
(CUR == ':') || (CUR == '-') || (CUR == '_'))) {
if ((CUR >= 'A') && (CUR <= 'Z')) loc[i] = CUR + 0x20;
else loc[i] = CUR;
......@@ -2261,7 +2261,7 @@ htmlParseHTMLAttribute(htmlParserCtxtPtr ctxt, const xmlChar stop) {
*/
while ((CUR != 0) && (CUR != stop)) {
if ((stop == 0) && (CUR == '>')) break;
if ((stop == 0) && (IS_BLANK(CUR))) break;
if ((stop == 0) && (IS_BLANK_CH(CUR))) break;
if (CUR == '&') {
if (NXT(1) == '#') {
unsigned int c;
......@@ -2474,9 +2474,9 @@ htmlParseSystemLiteral(htmlParserCtxtPtr ctxt) {
if (CUR == '"') {
NEXT;
q = CUR_PTR;
while ((IS_CHAR((unsigned int) CUR)) && (CUR != '"'))
while ((IS_CHAR_CH(CUR)) && (CUR != '"'))
NEXT;
if (!IS_CHAR((unsigned int) CUR)) {
if (!IS_CHAR_CH(CUR)) {
htmlParseErr(ctxt, XML_ERR_LITERAL_NOT_FINISHED,
"Unfinished SystemLiteral\n", NULL, NULL);
} else {
......@@ -2486,9 +2486,9 @@ htmlParseSystemLiteral(htmlParserCtxtPtr ctxt) {
} else if (CUR == '\'') {
NEXT;
q = CUR_PTR;
while ((IS_CHAR((unsigned int) CUR)) && (CUR != '\''))
while ((IS_CHAR_CH(CUR)) && (CUR != '\''))
NEXT;
if (!IS_CHAR((unsigned int) CUR)) {
if (!IS_CHAR_CH(CUR)) {
htmlParseErr(ctxt, XML_ERR_LITERAL_NOT_FINISHED,
"Unfinished SystemLiteral\n", NULL, NULL);
} else {
......@@ -2524,7 +2524,7 @@ htmlParsePubidLiteral(htmlParserCtxtPtr ctxt) {
if (CUR == '"') {
NEXT;
q = CUR_PTR;
while (IS_PUBIDCHAR(CUR)) NEXT;
while (IS_PUBIDCHAR_CH(CUR)) NEXT;
if (CUR != '"') {
htmlParseErr(ctxt, XML_ERR_LITERAL_NOT_FINISHED,
"Unfinished PubidLiteral\n", NULL, NULL);
......@@ -2535,7 +2535,7 @@ htmlParsePubidLiteral(htmlParserCtxtPtr ctxt) {
} else if (CUR == '\'') {
NEXT;
q = CUR_PTR;
while ((IS_PUBIDCHAR(CUR)) && (CUR != '\''))
while ((IS_PUBIDCHAR_CH(CUR)) && (CUR != '\''))
NEXT;
if (CUR != '\'') {
htmlParseErr(ctxt, XML_ERR_LITERAL_NOT_FINISHED,
......@@ -2581,7 +2581,7 @@ htmlParseScript(htmlParserCtxtPtr ctxt) {
SHRINK;
cur = CUR;
while (IS_CHAR((unsigned int) cur)) {
while (IS_CHAR_CH(cur)) {
if ((cur == '<') && (NXT(1) == '!') && (NXT(2) == '-') &&
(NXT(3) == '-')) {
if ((nbchar != 0) && (ctxt->sax != NULL) && (!ctxt->disableSAX)) {
......@@ -2624,7 +2624,7 @@ htmlParseScript(htmlParserCtxtPtr ctxt) {
NEXT;
cur = CUR;
}
if (!(IS_CHAR((unsigned int) cur))) {
if (!(IS_CHAR_CH(cur))) {
htmlParseErrInt(ctxt, XML_ERR_INVALID_CHAR,
"Invalid char in CDATA 0x%X\n", cur);
NEXT;
......@@ -2738,7 +2738,7 @@ htmlParseExternalID(htmlParserCtxtPtr ctxt, xmlChar **publicID) {
(UPP(2) == 'S') && (UPP(3) == 'T') &&
(UPP(4) == 'E') && (UPP(5) == 'M')) {
SKIP(6);
if (!IS_BLANK(CUR)) {
if (!IS_BLANK_CH(CUR)) {
htmlParseErr(ctxt, XML_ERR_SPACE_REQUIRED,
"Space required after 'SYSTEM'\n", NULL, NULL);
}
......@@ -2752,7 +2752,7 @@ htmlParseExternalID(htmlParserCtxtPtr ctxt, xmlChar **publicID) {
(UPP(2) == 'B') && (UPP(3) == 'L') &&
(UPP(4) == 'I') && (UPP(5) == 'C')) {
SKIP(6);
if (!IS_BLANK(CUR)) {
if (!IS_BLANK_CH(CUR)) {
htmlParseErr(ctxt, XML_ERR_SPACE_REQUIRED,
"Space required after 'PUBLIC'\n", NULL, NULL);
}
......@@ -3199,7 +3199,7 @@ htmlParseStartTag(htmlParserCtxtPtr ctxt) {
"htmlParseStartTag: invalid element name\n",
NULL, NULL);
/* Dump the bogus tag like browsers do */
while ((IS_CHAR((unsigned int) CUR)) && (CUR != '>'))
while ((IS_CHAR_CH(CUR)) && (CUR != '>'))
NEXT;
return;
}
......@@ -3251,7 +3251,7 @@ htmlParseStartTag(htmlParserCtxtPtr ctxt) {
* (S Attribute)* S?
*/
SKIP_BLANKS;
while ((IS_CHAR((unsigned int) CUR)) &&
while ((IS_CHAR_CH(CUR)) &&
(CUR != '>') &&
((CUR != '/') || (NXT(1) != '>'))) {
long cons = ctxt->nbChars;
......@@ -3314,8 +3314,8 @@ htmlParseStartTag(htmlParserCtxtPtr ctxt) {
xmlFree(attvalue);
/* Dump the bogus attribute string up to the next blank or
* the end of the tag. */
while ((IS_CHAR((unsigned int) CUR)) &&
!(IS_BLANK(CUR)) && (CUR != '>') &&
while ((IS_CHAR_CH(CUR)) &&
!(IS_BLANK_CH(CUR)) && (CUR != '>') &&
((CUR != '/') || (NXT(1) != '>')))
NEXT;
}
......@@ -3392,7 +3392,7 @@ htmlParseEndTag(htmlParserCtxtPtr ctxt)
* We should definitely be at the ending "S? '>'" part
*/
SKIP_BLANKS;
if ((!IS_CHAR((unsigned int) CUR)) || (CUR != '>')) {
if ((!IS_CHAR_CH(CUR)) || (CUR != '>')) {
htmlParseErr(ctxt, XML_ERR_GT_REQUIRED,
"End tag : expected '>'\n", NULL, NULL);
} else
......@@ -3743,7 +3743,7 @@ htmlParseElement(htmlParserCtxtPtr ctxt) {
*/
currentNode = xmlStrdup(ctxt->name);
depth = ctxt->nameNr;
while (IS_CHAR((unsigned int) CUR)) {
while (IS_CHAR_CH(CUR)) {
oldptr = ctxt->input->cur;
htmlParseContent(ctxt);
if (oldptr==ctxt->input->cur) break;
......@@ -3760,7 +3760,7 @@ htmlParseElement(htmlParserCtxtPtr ctxt) {
node_info.node = ctxt->node;
xmlParserAddNodeInfo(ctxt, &node_info);
}
if (!IS_CHAR((unsigned int) CUR)) {
if (!IS_CHAR_CH(CUR)) {
htmlAutoCloseOnEnd(ctxt);
}
......@@ -4335,7 +4335,7 @@ htmlParseTryOrFinish(htmlParserCtxtPtr ctxt, int terminate) {
* Very first chars read from the document flow.
*/
cur = in->cur[0];
if (IS_BLANK(cur)) {
if (IS_BLANK_CH(cur)) {
SKIP_BLANKS;
if (in->buf == NULL)
avail = in->length - (in->cur - in->base);
......@@ -4467,7 +4467,7 @@ htmlParseTryOrFinish(htmlParserCtxtPtr ctxt, int terminate) {
if (avail < 1)
goto done;
cur = in->cur[0];
if (IS_BLANK(cur)) {
if (IS_BLANK_CH(cur)) {
htmlParseCharData(ctxt);
goto done;
}
......@@ -4623,7 +4623,7 @@ htmlParseTryOrFinish(htmlParserCtxtPtr ctxt, int terminate) {
cur = in->cur[0];
if ((cur != '<') && (cur != '&')) {
if (ctxt->sax != NULL) {
if (IS_BLANK(cur)) {
if (IS_BLANK_CH(cur)) {
if (ctxt->sax->ignorableWhitespace != NULL)
ctxt->sax->ignorableWhitespace(
ctxt->userData, &cur, 1);
......
......@@ -665,7 +665,7 @@ htmlAttrDumpOutput(xmlOutputBufferPtr buf, xmlDocPtr doc, xmlAttrPtr cur,
xmlChar *escaped;
xmlChar *tmp = value;
while (IS_BLANK(*tmp)) tmp++;
while (IS_BLANK_CH(*tmp)) tmp++;
escaped = xmlURIEscapeStr(tmp, BAD_CAST"@/:=?;#%&,+");
if (escaped != NULL) {
......
......@@ -1635,12 +1635,12 @@ xmlSAX2TextNode(xmlParserCtxtPtr ctxt, const xmlChar *str, int len) {
if ((len <= 3) && ((cur == '"') || (cur == '\'') ||
((cur == '<') && (str[len + 1] != '!')))) {
intern = xmlDictLookup(ctxt->dict, str, len);
} else if (IS_BLANK(*str) && (len < 60) && (cur == '<') &&
} else if (IS_BLANK_CH(*str) && (len < 60) && (cur == '<') &&
(str[len + 1] != '!')) {
int i;
for (i = 1;i < len;i++) {
if (!IS_BLANK(*str)) goto skip;
if (!IS_BLANK_CH(*str)) goto skip;
}
intern = xmlDictLookup(ctxt->dict, str, len);
}
......
......@@ -2029,10 +2029,10 @@ xmlParseSGMLCatalogPubid(const xmlChar *cur, xmlChar **id) {
xmlCatalogErrMemory("allocating public ID");
return(NULL);
}
while (xmlIsPubidCharQ(*cur) || (*cur == '?')) {
while (IS_PUBIDCHAR_CH(*cur) || (*cur == '?')) {
if ((*cur == stop) && (stop != ' '))
break;
if ((stop == ' ') && (IS_BLANK(*cur)))
if ((stop == ' ') && (IS_BLANK_CH(*cur)))
break;
if (len + 1 >= size) {
size *= 2;
......@@ -2050,7 +2050,7 @@ xmlParseSGMLCatalogPubid(const xmlChar *cur, xmlChar **id) {
}
buf[len] = 0;
if (stop == ' ') {
if (!IS_BLANK(*cur)) {
if (!IS_BLANK_CH(*cur)) {
xmlFree(buf);
return(NULL);
}
......@@ -2185,7 +2185,7 @@ xmlParseSGMLCatalog(xmlCatalogPtr catal, const xmlChar *value,
/* error */
break;
}
if (!IS_BLANK(*cur)) {
if (!IS_BLANK_CH(*cur)) {
/* error */
break;
}
......@@ -2240,7 +2240,7 @@ xmlParseSGMLCatalog(xmlCatalogPtr catal, const xmlChar *value,
/* error */
break;
}
if (!IS_BLANK(*cur)) {
if (!IS_BLANK_CH(*cur)) {
/* error */
break;
}
......@@ -2259,7 +2259,7 @@ xmlParseSGMLCatalog(xmlCatalogPtr catal, const xmlChar *value,
/* error */
break;
}
if (!IS_BLANK(*cur)) {
if (!IS_BLANK_CH(*cur)) {
/* error */
break;
}
......
......@@ -52,7 +52,7 @@ xmlDebugDumpString(FILE * output, const xmlChar * str)
for (i = 0; i < 40; i++)
if (str[i] == 0)
return;
else if (IS_BLANK(str[i]))
else if (IS_BLANK_CH(str[i]))
fputc(' ', output);
else if (str[i] >= 0x80)
fprintf(output, "#%X", str[i]);
......
......@@ -17,6 +17,7 @@
#include <libxml/hash.h>
#include <libxml/entities.h>
#include <libxml/parser.h>
#include <libxml/parserInternals.h>
#include <libxml/xmlerror.h>
#include <libxml/globals.h>
......@@ -395,15 +396,6 @@ xmlGetDocEntity(xmlDocPtr doc, const xmlChar *name) {
return(xmlGetPredefinedEntity(name));
}
/*
* [2] Char ::= #x9 | #xA | #xD | [#x20-#xD7FF] | [#xE000-#xFFFD]
* | [#x10000-#x10FFFF]
* any Unicode character, excluding the surrogate blocks, FFFE, and FFFF.
*/
#define IS_CHAR(c) \
(((c) == 0x09) || ((c) == 0x0a) || ((c) == 0x0d) || \
(((c) >= 0x20) && ((c) != 0xFFFE) && ((c) != 0xFFFF)))
/*
* Macro used to grow the current buffer.
*/
......@@ -563,7 +555,7 @@ xmlEncodeEntitiesReentrant(xmlDocPtr doc, const xmlChar *input) {
cur += l;
continue;
}
} else if (IS_CHAR((unsigned int) *cur)) {
} else if (IS_BYTE_CHAR(*cur)) {
char buf[11], *ptr;
snprintf(buf, sizeof(buf), "&#%d;", *cur);
......
......@@ -72,6 +72,14 @@ XMLPUBVAR unsigned int xmlParserMaxDepth;
*/
#define IS_CHAR(c) xmlIsCharQ(c)
/**
* IS_CHAR_CH:
* @c: an xmlChar (usually an unsigned char)
*
* Behaves like IS_CHAR on single-byte value
*/
#define IS_CHAR_CH(c) xmlIsChar_ch(c)
/**
* IS_BLANK:
* @c: an UNICODE value (int)
......@@ -82,6 +90,14 @@ XMLPUBVAR unsigned int xmlParserMaxDepth;
*/
#define IS_BLANK(c) xmlIsBlankQ(c)
/**
* IS_BLANK_CH:
* @c: an xmlChar value (normally unsigned char)
*
* Behaviour same as IS_BLANK
*/
#define IS_BLANK_CH(c) xmlIsBlank_ch(c)
/**
* IS_BASECHAR:
* @c: an UNICODE value (int)
......@@ -102,6 +118,14 @@ XMLPUBVAR unsigned int xmlParserMaxDepth;
*/
#define IS_DIGIT(c) xmlIsDigitQ(c)
/**
* IS_DIGIT_CH:
* @c: an xmlChar value (usually an unsigned char)
*
* Behaves like IS_DIGIT but with a single byte argument
*/
#define IS_DIGIT_CH(c) xmlIsDigit_ch(c)
/**
* IS_COMBINING:
* @c: an UNICODE value (int)
......@@ -112,6 +136,14 @@ XMLPUBVAR unsigned int xmlParserMaxDepth;
*/
#define IS_COMBINING(c) xmlIsCombiningQ(c)
/**
* IS_COMBINING_CH:
* @c: an xmlChar (usually an unsigned char)
*
* Always false (all combining chars > 0xff)
*/
#define IS_COMBINING_CH(c) 0
/**
* IS_EXTENDER:
* @c: an UNICODE value (int)
......@@ -125,6 +157,14 @@ XMLPUBVAR unsigned int xmlParserMaxDepth;
*/
#define IS_EXTENDER(c) xmlIsExtenderQ(c)
/**
* IS_EXTENDER_CH:
* @c: an xmlChar value (usually an unsigned char)
*
* Behaves like IS_EXTENDER but with a single-byte argument
*/
#define IS_EXTENDER_CH(c) xmlIsExtender_ch(c)
/**
* IS_IDEOGRAPHIC:
* @c: an UNICODE value (int)
......@@ -147,7 +187,14 @@ XMLPUBVAR unsigned int xmlParserMaxDepth;
*/
#define IS_LETTER(c) (IS_BASECHAR(c) || IS_IDEOGRAPHIC(c))
/**
* IS_LETTER_CH:
* @c: an xmlChar value (normally unsigned char)
*
* Macro behaves like IS_LETTER, but only check base chars
*
*/
#define IS_LETTER_CH(c) xmlIsBaseChar_ch(c)
/**
* IS_PUBIDCHAR:
* @c: an UNICODE value (int)
......@@ -159,6 +206,14 @@ XMLPUBVAR unsigned int xmlParserMaxDepth;
*/
#define IS_PUBIDCHAR(c) xmlIsPubidCharQ(c)
/**
* IS_PUBIDCHAR_CH:
* @c: an xmlChar value (normally unsigned char)
*
* Same as IS_PUBIDCHAR but for single-byte value
*/
#define IS_PUBIDCHAR_CH(c) xmlIsPubidChar_ch(c)
/**
* SKIP_EOL:
* @p: and UTF8 string pointer
......
......@@ -1284,7 +1284,7 @@ xmlSkipBlankChars(xmlParserCtxtPtr ctxt) {
* if we are in the document content, go really fast
*/
cur = ctxt->input->cur;
while (IS_BLANK(*cur)) {
while (IS_BLANK_CH(*cur)) {
if (*cur == '\n') {
ctxt->input->line++; ctxt->input->col = 1;
}
......@@ -1687,7 +1687,7 @@ xmlParserHandlePEReference(xmlParserCtxtPtr ctxt) {
*/
if ((ctxt->external == 0) && (ctxt->inputNr == 1))
return;
if (IS_BLANK(NXT(1)) || NXT(1) == 0)
if (IS_BLANK_CH(NXT(1)) || NXT(1) == 0)
return;
break;
case XML_PARSER_IGNORE:
......@@ -1774,7 +1774,8 @@ xmlParserHandlePEReference(xmlParserCtxtPtr ctxt) {
}
if ((entity->etype == XML_EXTERNAL_PARAMETER_ENTITY) &&
(memcmp(CUR_PTR, "<?xml", 5) == 0) && (IS_BLANK(NXT(5)))) {
(memcmp(CUR_PTR, "<?xml", 5) == 0) &&
(IS_BLANK_CH(NXT(5)))) {
xmlParseTextDecl(ctxt);
}
} else {
......@@ -2500,7 +2501,7 @@ static int areBlanks(xmlParserCtxtPtr ctxt, const xmlChar *str, int len) {
* Check that the string is made of blanks
*/
for (i = 0;i < len;i++)
if (!(IS_BLANK(str[i]))) return(0);
if (!(IS_BLANK_CH(str[i]))) return(0);
/*
* Look if the element is mixed content in the DTD if available
......@@ -2785,7 +2786,7 @@ xmlParseNameAndCompare(xmlParserCtxtPtr ctxt, xmlChar const *other) {
++in;
++cmp;
}
if (*cmp == 0 && (*in == '>' || IS_BLANK (*in))) {
if (*cmp == 0 && (*in == '>' || IS_BLANK_CH (*in))) {
/* success */
ctxt->input->cur = in;
return (const xmlChar*) 1;
......@@ -3475,7 +3476,7 @@ xmlParsePubidLiteral(xmlParserCtxtPtr ctxt) {
}
ctxt->instate = XML_PARSER_PUBLIC_LITERAL;
cur = CUR;
while ((IS_PUBIDCHAR(cur)) && (cur != stop)) { /* checked */
while ((IS_PUBIDCHAR_CH(cur)) && (cur != stop)) { /* checked */
if (len + 1 >= size) {
size *= 2;
buf = (xmlChar *) xmlRealloc(buf, size * sizeof(xmlChar));
......@@ -3567,7 +3568,7 @@ get_more:
if (nbchar > 0) {
if ((ctxt->sax->ignorableWhitespace !=
ctxt->sax->characters) &&
(IS_BLANK(*ctxt->input->cur))) {
(IS_BLANK_CH(*ctxt->input->cur))) {
const xmlChar *tmp = ctxt->input->cur;
ctxt->input->cur = in;
......@@ -3719,7 +3720,7 @@ xmlParseExternalID(xmlParserCtxtPtr ctxt, xmlChar **publicID, int strict) {
*publicID = NULL;
if (memcmp(CUR_PTR, "SYSTEM", 6) == 0) {
SKIP(6);
if (!IS_BLANK(CUR)) {
if (!IS_BLANK_CH(CUR)) {
xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED,
"Space required after 'SYSTEM'\n");
}
......@@ -3730,7 +3731,7 @@ xmlParseExternalID(xmlParserCtxtPtr ctxt, xmlChar **publicID, int strict) {
}
} else if (memcmp(CUR_PTR, "PUBLIC", 6) == 0) {
SKIP(6);
if (!IS_BLANK(CUR)) {
if (!IS_BLANK_CH(CUR)) {
xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED,
"Space required after 'PUBLIC'\n");
}
......@@ -3743,7 +3744,7 @@ xmlParseExternalID(xmlParserCtxtPtr ctxt, xmlChar **publicID, int strict) {
/*
* We don't handle [83] so "S SystemLiteral" is required.
*/
if (!IS_BLANK(CUR)) {
if (!IS_BLANK_CH(CUR)) {
xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED,
"Space required after the Public Identifier\n");
}
......@@ -3757,9 +3758,9 @@ xmlParseExternalID(xmlParserCtxtPtr ctxt, xmlChar **publicID, int strict) {
GROW;
ptr = CUR_PTR;
if (!IS_BLANK(*ptr)) return(NULL);
if (!IS_BLANK_CH(*ptr)) return(NULL);
while (IS_BLANK(*ptr)) ptr++; /* TODO: dangerous, fix ! */
while (IS_BLANK_CH(*ptr)) ptr++; /* TODO: dangerous, fix ! */
if ((*ptr != '\'') && (*ptr != '"')) return(NULL);
}
SKIP_BLANKS;
......@@ -3944,16 +3945,16 @@ xmlParseCatalogPI(xmlParserCtxtPtr ctxt, const xmlChar *catalog) {
xmlChar marker;
tmp = catalog;
while (IS_BLANK(*tmp)) tmp++;
while (IS_BLANK_CH(*tmp)) tmp++;
if (xmlStrncmp(tmp, BAD_CAST"catalog", 7))
goto error;
tmp += 7;
while (IS_BLANK(*tmp)) tmp++;
while (IS_BLANK_CH(*tmp)) tmp++;
if (*tmp != '=') {
return;
}
tmp++;
while (IS_BLANK(*tmp)) tmp++;
while (IS_BLANK_CH(*tmp)) tmp++;
marker = *tmp;
if ((marker != '\'') && (marker != '"'))
goto error;
......@@ -3964,7 +3965,7 @@ xmlParseCatalogPI(xmlParserCtxtPtr ctxt, const xmlChar *catalog) {
goto error;
URL = xmlStrndup(base, tmp - base);
tmp++;
while (IS_BLANK(*tmp)) tmp++;
while (IS_BLANK_CH(*tmp)) tmp++;
if (*tmp != 0)
goto error;
......@@ -4140,7 +4141,7 @@ xmlParseNotationDecl(xmlParserCtxtPtr ctxt) {
xmlParserInputPtr input = ctxt->input;
SHRINK;
SKIP(10);
if (!IS_BLANK(CUR)) {
if (!IS_BLANK_CH(CUR)) {
xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED,
"Space required after '<!NOTATION'\n");
return;
......@@ -4152,7 +4153,7 @@ xmlParseNotationDecl(xmlParserCtxtPtr ctxt) {
xmlFatalErr(ctxt, XML_ERR_NOTATION_NOT_STARTED, NULL);
return;
}
if (!IS_BLANK(CUR)) {
if (!IS_BLANK_CH(CUR)) {
xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED,
"Space required after the NOTATION name'\n");
return;
......@@ -4348,14 +4349,14 @@ xmlParseEntityDecl(xmlParserCtxtPtr ctxt) {
xmlFreeURI(uri);
}
}
if ((RAW != '>') && (!IS_BLANK(CUR))) {
if ((RAW != '>') && (!IS_BLANK_CH(CUR))) {
xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED,
"Space required before 'NDATA'\n");
}
SKIP_BLANKS;
if (memcmp(CUR_PTR, "NDATA", 5) == 0) {
SKIP(5);
if (!IS_BLANK(CUR)) {
if (!IS_BLANK_CH(CUR)) {
xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED,
"Space required after 'NDATA'\n");
}
......@@ -4482,7 +4483,7 @@ xmlParseDefaultDecl(xmlParserCtxtPtr ctxt, xmlChar **value) {
if (memcmp(CUR_PTR, "#FIXED", 6) == 0) {
SKIP(6);
val = XML_ATTRIBUTE_FIXED;
if (!IS_BLANK(CUR)) {
if (!IS_BLANK_CH(CUR)) {
xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED,
"Space required after '#FIXED'\n");
}
......@@ -4623,7 +4624,7 @@ int
xmlParseEnumeratedType(xmlParserCtxtPtr ctxt, xmlEnumerationPtr *tree) {
if (memcmp(CUR_PTR, "NOTATION", 8) == 0) {
SKIP(8);
if (!IS_BLANK(CUR)) {
if (!IS_BLANK_CH(CUR)) {
xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED,
"Space required after 'NOTATION'\n");
return(0);
......@@ -4735,7 +4736,7 @@ xmlParseAttributeListDecl(xmlParserCtxtPtr ctxt) {
xmlParserInputPtr input = ctxt->input;
SKIP(9);
if (!IS_BLANK(CUR)) {
if (!IS_BLANK_CH(CUR)) {
xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED,
"Space required after '<!ATTLIST'\n");
}
......@@ -4763,7 +4764,7 @@ xmlParseAttributeListDecl(xmlParserCtxtPtr ctxt) {
break;
}
GROW;
if (!IS_BLANK(CUR)) {
if (!IS_BLANK_CH(CUR)) {
xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED,
"Space required after the attribute name\n");
if (defaultValue != NULL)
......@@ -4780,7 +4781,7 @@ xmlParseAttributeListDecl(xmlParserCtxtPtr ctxt) {
}
GROW;
if (!IS_BLANK(CUR)) {
if (!IS_BLANK_CH(CUR)) {