diff options
author | Daniel Veillard <veillard@src.gnome.org> | 2008-03-25 13:22:41 +0000 |
---|---|---|
committer | Daniel Veillard <veillard@src.gnome.org> | 2008-03-25 13:22:41 +0000 |
commit | e54c3173b85d2d7eb90fb3b95d96dc761018c15b (patch) | |
tree | a3183478167e0700f9be331952bf25fcadcdd621 /uri.c | |
parent | 8bf64aef50fe0e969f3b0ac3cd3f58c53fd5c4ff (diff) | |
download | libxml2-e54c3173b85d2d7eb90fb3b95d96dc761018c15b.tar.gz |
fix saving for file:///X:/ URI embedding Windows file paths should fix
* uri.c: fix saving for file:///X:/ URI embedding Windows file paths
should fix #524253
Daniel
svn path=/trunk/; revision=3714
Diffstat (limited to 'uri.c')
-rw-r--r-- | uri.c | 24 |
1 files changed, 24 insertions, 0 deletions
@@ -421,6 +421,30 @@ xmlSaveUri(xmlURIPtr uri) { } if (uri->path != NULL) { p = uri->path; + /* + * the colon in file:///d: should not be escaped or + * Windows accesses fail later. + */ + if ((uri->scheme != NULL) && + (p[0] == '/') && + (((p[1] >= 'a') && (p[1] <= 'z')) || + ((p[1] >= 'A') && (p[1] <= 'Z'))) && + (p[2] == ':') && + (xmlStrEqual(uri->scheme, BAD_CAST "file"))) { + if (len + 3 >= max) { + max *= 2; + ret = (xmlChar *) xmlRealloc(ret, + (max + 1) * sizeof(xmlChar)); + if (ret == NULL) { + xmlGenericError(xmlGenericErrorContext, + "xmlSaveUri: out of memory\n"); + return(NULL); + } + } + ret[len++] = *p++; + ret[len++] = *p++; + ret[len++] = *p++; + } while (*p != 0) { if (len + 3 >= max) { max *= 2; |