aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Veillard <veillard@src.gnome.org>2007-04-17 12:33:19 +0000
committerDaniel Veillard <veillard@src.gnome.org>2007-04-17 12:33:19 +0000
commited12138b18935276f3815f42a108192cf8b1bf12 (patch)
tree92383ded7df905eb56e09d431fc4218c392cc4f5
parent42720248e6d0576c6f2df377cc61a9642bdd28f3 (diff)
downloadandroid_external_libxml2-ed12138b18935276f3815f42a108192cf8b1bf12.tar.gz
android_external_libxml2-ed12138b18935276f3815f42a108192cf8b1bf12.tar.bz2
android_external_libxml2-ed12138b18935276f3815f42a108192cf8b1bf12.zip
"xmllint unusable on win32" so applied a libxml2 patch from Christian
* xmllint.c catalog.c: "xmllint unusable on win32" so applied a libxml2 patch from Christian Ehrlicher Daniel svn path=/trunk/; revision=3599
-rw-r--r--ChangeLog5
-rw-r--r--catalog.c21
-rw-r--r--xmllint.c9
3 files changed, 31 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index 2c6b078b..2a63ac77 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Tue Apr 17 14:34:45 CEST 2007 Daniel Veillard <daniel@veillard.com>
+
+ * xmllint.c catalog.c: "xmllint unusable on win32" so applied
+ a libxml2 patch from Christian Ehrlicher
+
Mon Apr 16 09:05:01 CEST 2007 Daniel Veillard <daniel@veillard.com>
* HTMLparser.c: change the way script/style are parsed to
diff --git a/catalog.c b/catalog.c
index 5456094d..92f5da52 100644
--- a/catalog.c
+++ b/catalog.c
@@ -44,6 +44,12 @@
#define MAX_DELEGATE 50
#define MAX_CATAL_DEPTH 50
+#ifdef _WIN32
+# define PATH_SEAPARATOR ';'
+#else
+# define PATH_SEAPARATOR ':'
+#endif
+
/**
* TODO:
*
@@ -3209,6 +3215,9 @@ xmlLoadCatalogs(const char *pathss) {
const char *cur;
const char *paths;
xmlChar *path;
+#ifdef _WIN32
+ int i, iLen;
+#endif
if (pathss == NULL)
return;
@@ -3218,15 +3227,23 @@ xmlLoadCatalogs(const char *pathss) {
while (xmlIsBlank_ch(*cur)) cur++;
if (*cur != 0) {
paths = cur;
- while ((*cur != 0) && (*cur != ':') && (!xmlIsBlank_ch(*cur)))
+ while ((*cur != 0) && (*cur != PATH_SEAPARATOR) && (!xmlIsBlank_ch(*cur)))
cur++;
path = xmlStrndup((const xmlChar *)paths, cur - paths);
+#ifdef _WIN32
+ iLen = strlen(path);
+ for(i = 0; i < iLen; i++) {
+ if(path[i] == '\\') {
+ path[i] = '/';
+ }
+ }
+#endif
if (path != NULL) {
xmlLoadCatalog((const char *) path);
xmlFree(path);
}
}
- while (*cur == ':')
+ while (*cur == PATH_SEAPARATOR)
cur++;
}
}
diff --git a/xmllint.c b/xmllint.c
index 5e1bfd72..5c27eb25 100644
--- a/xmllint.c
+++ b/xmllint.c
@@ -209,6 +209,11 @@ static int sax = 0;
* *
************************************************************************/
#define MAX_PATHS 64
+#ifdef _WIN32
+# define PATH_SEPARATOR ';'
+#else
+# define PATH_SEPARATOR ':'
+#endif
static xmlChar *paths[MAX_PATHS + 1];
static int nbpaths = 0;
static int load_trace = 0;
@@ -225,10 +230,10 @@ void parsePath(const xmlChar *path) {
return;
}
cur = path;
- while ((*cur == ' ') || (*cur == ':'))
+ while ((*cur == ' ') || (*cur == PATH_SEPARATOR))
cur++;
path = cur;
- while ((*cur != 0) && (*cur != ' ') && (*cur != ':'))
+ while ((*cur != 0) && (*cur != ' ') && (*cur != PATH_SEPARATOR))
cur++;
if (cur != path) {
paths[nbpaths] = xmlStrndup(path, cur - path);