summaryrefslogtreecommitdiffstats
path: root/third_party/libxml/uri.c
diff options
context:
space:
mode:
authormaruel@google.com <maruel@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-08-08 19:12:46 +0000
committermaruel@google.com <maruel@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-08-08 19:12:46 +0000
commit505115c27f5454df0878407c7706c7f1c3744b0d (patch)
treedf43feb18444d5be3bf35ed3ee16156d49e17776 /third_party/libxml/uri.c
parente8c2172aa23158985682d232cf290593b8206b90 (diff)
downloadchromium_src-505115c27f5454df0878407c7706c7f1c3744b0d.zip
chromium_src-505115c27f5454df0878407c7706c7f1c3744b0d.tar.gz
chromium_src-505115c27f5454df0878407c7706c7f1c3744b0d.tar.bz2
Updates libxml to 2.6.32. Updated google.patch and README.google
BUG=1300342 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@581 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'third_party/libxml/uri.c')
-rw-r--r--third_party/libxml/uri.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/third_party/libxml/uri.c b/third_party/libxml/uri.c
index 34841af..fafd112 100644
--- a/third_party/libxml/uri.c
+++ b/third_party/libxml/uri.c
@@ -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;
@@ -2418,6 +2442,11 @@ xmlCanonicPath(const xmlChar *path)
if (path == NULL)
return(NULL);
+
+ /* sanitize filename starting with // so it can be used as URI */
+ if ((path[0] == '/') && (path[1] == '/') && (path[2] != '/'))
+ path++;
+
if ((uri = xmlParseURI((const char *) path)) != NULL) {
xmlFreeURI(uri);
return xmlStrdup(path);