summaryrefslogtreecommitdiff
path: root/tools/source
diff options
context:
space:
mode:
authorStephan Bergmann <sb@openoffice.org>2002-09-06 12:31:02 +0000
committerStephan Bergmann <sb@openoffice.org>2002-09-06 12:31:02 +0000
commita6b00d396a8d113f1cb0a7ea7654c9d7dc75042d (patch)
tree2c4c2fb3b873c4103a2ea6a9dd5fa8df72590638 /tools/source
parent992541b6395bec8b22bba942d42ead6e821cc0ff (diff)
#102967# When smart parsing, accept things like file://d:\dir1\file1 as file URLs (generated by MS IE).
Diffstat (limited to 'tools/source')
-rw-r--r--tools/source/fsys/urlobj.cxx35
1 files changed, 27 insertions, 8 deletions
diff --git a/tools/source/fsys/urlobj.cxx b/tools/source/fsys/urlobj.cxx
index 37fbdead104d..987f535d6890 100644
--- a/tools/source/fsys/urlobj.cxx
+++ b/tools/source/fsys/urlobj.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: urlobj.cxx,v $
*
- * $Revision: 1.32 $
+ * $Revision: 1.33 $
*
- * last change: $Author: sb $ $Date: 2002-08-28 14:24:15 $
+ * last change: $Author: sb $ $Date: 2002-09-06 13:29:03 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -1014,7 +1014,19 @@ bool INetURLObject::setAbsURIRef(UniString const & rTheAbsURIRef,
}
}
- // 2nd Production (misscounted slashes):
+ // 2nd Production (MS IE generated 1; FSYS_DOS only):
+ // "//" ALPHA ":" ["/" *path] ["#" *UCS4]
+ // becomes
+ // "file:///" ALPHA ":" ["/" *path] ["#" *UCS4]
+ // replacing "\" by "/" within <*path>
+ //
+ // 3rd Production (MS IE generated 2; FSYS_DOS only):
+ // "//" ALPHA ":" ["\" *path] ["#" *UCS4]
+ // becomes
+ // "file:///" ALPHA ":" ["/" *path] ["#" *UCS4]
+ // replacing "\" by "/" within <*path>
+ //
+ // 4th Production (misscounted slashes):
// "//" *path ["#" *UCS4]
// becomes
// "file:///" *path ["#" *UCS4]
@@ -1024,10 +1036,17 @@ bool INetURLObject::setAbsURIRef(UniString const & rTheAbsURIRef,
AppendAscii(RTL_CONSTASCII_STRINGPARAM("//"));
pPos += 2;
bSkippedInitialSlash = true;
+ if ((eStyle & FSYS_DOS) != 0
+ && pEnd - pPos >= 2
+ && INetMIME::isAlpha(pPos[0])
+ && pPos[1] == ':'
+ && (pEnd - pPos == 2
+ || pPos[2] == '/' || pPos[2] == '\\'))
+ nAltSegmentDelimiter = '\\';
break;
}
- // 3rd Production (Unix):
+ // 5th Production (Unix):
// "/" *path ["#" *UCS4]
// becomes
// "file:///" *path ["#" *UCS4]
@@ -1038,7 +1057,7 @@ bool INetURLObject::setAbsURIRef(UniString const & rTheAbsURIRef,
break;
}
- // 4th Production (UNC; FSYS_DOS only):
+ // 6th Production (UNC; FSYS_DOS only):
// "\\" domain ["\" *path] ["#" *UCS4]
// becomes
// "file://" domain "/" *path ["#" *UCS4]
@@ -1063,13 +1082,13 @@ bool INetURLObject::setAbsURIRef(UniString const & rTheAbsURIRef,
}
}
- // 5th Production (Unix-like DOS; FSYS_DOS only):
+ // 7th Production (Unix-like DOS; FSYS_DOS only):
// ALPHA ":" ["/" *path] ["#" *UCS4]
// becomes
// "file:///" ALPHA ":" ["/" *path] ["#" *UCS4]
// replacing "\" by "/" within <*path>
//
- // 6th Production (DOS; FSYS_DOS only):
+ // 8th Production (DOS; FSYS_DOS only):
// ALPHA ":" ["\" *path] ["#" *UCS4]
// becomes
// "file:///" ALPHA ":" ["/" *path] ["#" *UCS4]
@@ -1089,7 +1108,7 @@ bool INetURLObject::setAbsURIRef(UniString const & rTheAbsURIRef,
break;
}
- // 7th Production (any):
+ // 9th Production (any):
// *path ["#" *UCS4]
// becomes
// "file:///" *path ["#" *UCS4]