updated libxml2 to 2.5.10
[TestXSLT.git] / libxml2 / entities.c
index f92f0cf..67317f3 100644 (file)
@@ -532,7 +532,7 @@ xmlEncodeEntities(xmlDocPtr doc, const xmlChar *input) {
             ptr = buf;
            while (*ptr != 0) *out++ = *ptr++;
 #endif
-       } else if (IS_CHAR(*cur)) {
+       } else if (IS_CHAR((unsigned int) *cur)) {
            char buf[10], *ptr;
 
            snprintf(buf, sizeof(buf), "&#%d;", *cur);
@@ -632,6 +632,7 @@ xmlEncodeEntitiesReentrant(xmlDocPtr doc, const xmlChar *input) {
            *out++ = 'm';
            *out++ = 'p';
            *out++ = ';';
+#if 0
        } else if (*cur == '"') {
            *out++ = '&';
            *out++ = 'q';
@@ -639,7 +640,6 @@ xmlEncodeEntitiesReentrant(xmlDocPtr doc, const xmlChar *input) {
            *out++ = 'o';
            *out++ = 't';
            *out++ = ';';
-#if 0
        } else if ((*cur == '\'') && (!html)) {
            *out++ = '&';
            *out++ = 'a';
@@ -731,7 +731,7 @@ xmlEncodeEntitiesReentrant(xmlDocPtr doc, const xmlChar *input) {
                cur += l;
                continue;
            }
-       } else if (IS_CHAR(*cur)) {
+       } else if (IS_CHAR((unsigned int) *cur)) {
            char buf[10], *ptr;
 
            snprintf(buf, sizeof(buf), "&#%d;", *cur);
@@ -822,6 +822,12 @@ xmlEncodeSpecialChars(xmlDocPtr doc, const xmlChar *input) {
            *out++ = 'o';
            *out++ = 't';
            *out++ = ';';
+       } else if (*cur == '\r') {
+           *out++ = '&';
+           *out++ = '#';
+           *out++ = '1';
+           *out++ = '3';
+           *out++ = ';';
        } else {
            /*
             * Works because on UTF-8, all extended sequences cannot