aboutsummaryrefslogtreecommitdiffstats
path: root/xmlIO.c
diff options
context:
space:
mode:
authorIgor Zlatkovic <igor@src.gnome.org>2002-10-04 13:32:07 +0000
committerIgor Zlatkovic <igor@src.gnome.org>2002-10-04 13:32:07 +0000
commit043620e1cbee6d76781811803e6468640c273ce4 (patch)
tree84adf5fdd2527cc63dffe2a47dbb76cb7f65a73a /xmlIO.c
parentceb09b956efa2cf1ec41c1887394396e5a6030f2 (diff)
downloadandroid_external_libxml2-043620e1cbee6d76781811803e6468640c273ce4.tar.gz
android_external_libxml2-043620e1cbee6d76781811803e6468640c273ce4.tar.bz2
android_external_libxml2-043620e1cbee6d76781811803e6468640c273ce4.zip
extended slashification to fix the base problem in xslt
Diffstat (limited to 'xmlIO.c')
-rw-r--r--xmlIO.c41
1 files changed, 25 insertions, 16 deletions
diff --git a/xmlIO.c b/xmlIO.c
index 9e84a3c9..796c8ac0 100644
--- a/xmlIO.c
+++ b/xmlIO.c
@@ -151,35 +151,44 @@ static int xmlOutputCallbackInitialized = 0;
xmlChar *
xmlNormalizeWindowsPath(const xmlChar *path)
{
- int len, i, j;
+ int len, i = 0, j;
xmlChar *ret;
if (path == NULL)
return(NULL);
- if (!IS_WINDOWS_PATH(path))
- return(xmlStrdup(path));
len = xmlStrlen(path);
- ret = xmlMalloc(len + 10);
- if (ret == NULL)
- return(NULL);
-
- ret[0] = 'f';
- ret[1] = 'i';
- ret[2] = 'l';
- ret[3] = 'e';
- ret[4] = ':';
- ret[5] = '/';
- ret[6] = '/';
- ret[7] = '/';
- for (i = 0,j = 8;i < len;i++,j++) {
+ if (!IS_WINDOWS_PATH(path)) {
+ ret = xmlStrdup(path);
+ if (ret == NULL)
+ return(NULL);
+ j = 0;
+ } else {
+ ret = xmlMalloc(len + 10);
+ if (ret == NULL)
+ return(NULL);
+ ret[0] = 'f';
+ ret[1] = 'i';
+ ret[2] = 'l';
+ ret[3] = 'e';
+ ret[4] = ':';
+ ret[5] = '/';
+ ret[6] = '/';
+ ret[7] = '/';
+ j = 8;
+ }
+
+ while (i < len) {
/* TODO: UTF8 conversion + URI escaping ??? */
if (path[i] == '\\')
ret[j] = '/';
else
ret[j] = path[i];
+ i++;
+ j++;
}
ret[j] = 0;
+
return(ret);
}