diff options
author | Jackson Harper <jackson@novell.com> | 2004-02-11 22:35:10 +0300 |
---|---|---|
committer | Jackson Harper <jackson@novell.com> | 2004-02-11 22:35:10 +0300 |
commit | eaa188c2fe955cebc28b7ce103cc9cdfb07b32b8 (patch) | |
tree | 0250cb2e2e97ecbee843986595e62687a0a37d90 /mcs/class/System/System | |
parent | ce4af61c7191bcffa95865007962490d5e50d84f (diff) |
* Uri.cs: If the relative uri passed to Uri (base_uri,
relative_uri) is an absolute uri do not combine the uris. The base
uri is dropped.
svn path=/trunk/mcs/; revision=22988
Diffstat (limited to 'mcs/class/System/System')
-rw-r--r-- | mcs/class/System/System/ChangeLog | 6 | ||||
-rwxr-xr-x | mcs/class/System/System/Uri.cs | 32 |
2 files changed, 22 insertions, 16 deletions
diff --git a/mcs/class/System/System/ChangeLog b/mcs/class/System/System/ChangeLog index 2743360367c..89bb05066a4 100644 --- a/mcs/class/System/System/ChangeLog +++ b/mcs/class/System/System/ChangeLog @@ -1,3 +1,9 @@ +2004-02-11 Jackson Harper <jackson@ximian.com> + + * Uri.cs: If the relative uri passed to Uri (base_uri, + relative_uri) is an absolute uri do not combine the uris. The base + uri is dropped. + 2004-02-10 Jackson Harper <jackson@ximian.com> * Uri.cs: Preserve the trailing / if there is one when reducing diff --git a/mcs/class/System/System/Uri.cs b/mcs/class/System/System/Uri.cs index 359eb8cbc5d..4102e37f8dd 100755 --- a/mcs/class/System/System/Uri.cs +++ b/mcs/class/System/System/Uri.cs @@ -112,25 +112,9 @@ namespace System userEscaped = dontEscape; - this.scheme = baseUri.scheme; - this.host = baseUri.host; - this.port = baseUri.port; - this.userinfo = baseUri.userinfo; - this.isUnc = baseUri.isUnc; - this.isWindowsFilePath = baseUri.isWindowsFilePath; - this.isUnixFilePath = baseUri.isUnixFilePath; - this.isOpaquePart = baseUri.isOpaquePart; - if (relativeUri == null) throw new NullReferenceException ("relativeUri"); - if (relativeUri == String.Empty) { - this.path = baseUri.path; - this.query = baseUri.query; - this.fragment = baseUri.fragment; - return; - } - int pos = relativeUri.IndexOf (':'); if (pos != -1) { @@ -149,6 +133,22 @@ namespace System } } + this.scheme = baseUri.scheme; + this.host = baseUri.host; + this.port = baseUri.port; + this.userinfo = baseUri.userinfo; + this.isUnc = baseUri.isUnc; + this.isWindowsFilePath = baseUri.isWindowsFilePath; + this.isUnixFilePath = baseUri.isUnixFilePath; + this.isOpaquePart = baseUri.isOpaquePart; + + if (relativeUri == String.Empty) { + this.path = baseUri.path; + this.query = baseUri.query; + this.fragment = baseUri.fragment; + return; + } + // 8 fragment pos = relativeUri.IndexOf ('#'); if (pos != -1) { |