Incorrect warning message on thread pool startup in full AOT:ed Windows build.
[mono.git] / mcs / class / System / System / UriBuilder.cs
index ca28836b77eac6b73680fc57456728a41a67436e..6d878731991f60945ebc74a77981c868acf44215 100644 (file)
@@ -74,10 +74,8 @@ namespace System
                
                public UriBuilder (Uri uri)
                {
-#if NET_4_0
                        if (uri == null)
                                throw new ArgumentNullException ("uri");
-#endif
                        Initialize (uri);
                }
                
@@ -265,7 +263,12 @@ namespace System
 
                        builder.Append (scheme);
                        // note: mailto and news use ':', not "://", as their delimiter
-                       builder.Append (Uri.GetSchemeDelimiter (scheme));
+                       if (UriParser.IsKnownScheme(scheme)) {
+                               builder.Append (Uri.GetSchemeDelimiter (scheme));
+                       }
+                       else {
+                               builder.Append (host.Length > 0 ? Uri.SchemeDelimiter : ":");
+                       }
 
                        if (username != String.Empty) {
                                builder.Append (username);
@@ -282,7 +285,8 @@ namespace System
 
                        if (path != String.Empty &&
                            builder [builder.Length - 1] != '/' &&
-                           path.Length > 0 && path [0] != '/')
+                           path.Length > 0 && path [0] != '/' &&
+                               host.Length > 0)
                                builder.Append ('/');
                        builder.Append (path);
                        builder.Append (query);