Imported Upstream version 6.8.0.73

Former-commit-id: d18deab1b47cfd3ad8cba82b3f37d00eec2170af
This commit is contained in:
Xamarin Public Jenkins (auto-signing)
2019-12-10 18:00:56 +00:00
parent bceda29824
commit 73ee7591e8
1043 changed files with 16271 additions and 22080 deletions

View File

@@ -758,7 +758,7 @@ namespace System {
throw new FileNotFoundException (null, assemblyRef.Name);
string cb = assemblyRef.CodeBase;
if (cb.ToLower (CultureInfo.InvariantCulture).StartsWith ("file://"))
if (cb.StartsWith ("file://", StringComparison.OrdinalIgnoreCase))
cb = new Mono.Security.Uri (cb).LocalPath;
try {

View File

@@ -31,6 +31,7 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
using System.Globalization;
using System.Collections.Generic;
using System.IO;
using System.Runtime.CompilerServices;
@@ -142,9 +143,8 @@ namespace System
if (appBase == null)
return null;
int len = appBase.Length;
if (len >= 8 && appBase.ToLower ().StartsWith ("file://")) {
appBase = appBase.Substring (7);
if (appBase.StartsWith ("file://", StringComparison.OrdinalIgnoreCase)) {
appBase = new Mono.Security.Uri (appBase).LocalPath;
if (Path.DirectorySeparatorChar != '/')
appBase = appBase.Replace ('/', Path.DirectorySeparatorChar);
}

View File

@@ -166,6 +166,12 @@ namespace System.IO {
}
}
}
public override void WriteLine (string val)
{
Write (val);
Write (NewLine);
}
}
}
#endif

View File

@@ -1254,8 +1254,11 @@ namespace System
private static DateTime TransitionPoint (TransitionTime transition, int year)
{
if (transition.IsFixedDateRule)
return new DateTime (year, transition.Month, transition.Day) + transition.TimeOfDay.TimeOfDay;
if (transition.IsFixedDateRule) {
var daysInMonth = DateTime.DaysInMonth (year, transition.Month);
var transitionDay = transition.Day <= daysInMonth ? transition.Day : daysInMonth;
return new DateTime (year, transition.Month, transitionDay) + transition.TimeOfDay.TimeOfDay;
}
DayOfWeek first = (new DateTime (year, transition.Month, 1)).DayOfWeek;
int day = 1 + (transition.Week - 1) * 7 + (transition.DayOfWeek - first + 7) % 7;