mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2025-01-13 13:17:36 +03:00
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
This commit is contained in:
parent
8bf64aef50
commit
e54c3173b8
@ -1,3 +1,8 @@
|
|||||||
|
Tue Mar 25 14:20:49 CET 2008 Daniel Veillard <daniel@veillard.com>
|
||||||
|
|
||||||
|
* uri.c: fix saving for file:///X:/ URI embedding Windows file paths
|
||||||
|
should fix #524253
|
||||||
|
|
||||||
Mon Mar 24 21:42:33 CET 2008 Daniel Veillard <daniel@veillard.com>
|
Mon Mar 24 21:42:33 CET 2008 Daniel Veillard <daniel@veillard.com>
|
||||||
|
|
||||||
* parser.c: fix a problem reported by Ashwin for system parameter
|
* parser.c: fix a problem reported by Ashwin for system parameter
|
||||||
|
24
uri.c
24
uri.c
@ -421,6 +421,30 @@ xmlSaveUri(xmlURIPtr uri) {
|
|||||||
}
|
}
|
||||||
if (uri->path != NULL) {
|
if (uri->path != NULL) {
|
||||||
p = uri->path;
|
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) {
|
while (*p != 0) {
|
||||||
if (len + 3 >= max) {
|
if (len + 3 >= max) {
|
||||||
max *= 2;
|
max *= 2;
|
||||||
|
Loading…
Reference in New Issue
Block a user