diff options
author | Igor Zlatkovic <igor@src.gnome.org> | 2002-10-04 13:32:07 +0000 |
---|---|---|
committer | Igor Zlatkovic <igor@src.gnome.org> | 2002-10-04 13:32:07 +0000 |
commit | 043620e1cbee6d76781811803e6468640c273ce4 (patch) | |
tree | 84adf5fdd2527cc63dffe2a47dbb76cb7f65a73a /xmlIO.c | |
parent | ceb09b956efa2cf1ec41c1887394396e5a6030f2 (diff) | |
download | android_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.c | 41 |
1 files changed, 25 insertions, 16 deletions
@@ -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); } |