Author: spouliot
Date: 2005-12-08 20:18:46 -0500 (Thu, 08 Dec 2005)
New Revision: 54139
Modified:
trunk/mcs/class/corlib/System/AppDomainSetup.cs
trunk/mcs/class/corlib/System/ChangeLog
trunk/mcs/class/corlib/System/DateTime.cs
Log:
2005-12-08 Sebastien Pouliot <[EMAIL PROTECTED]>
* AppDomainSetup.cs: ApplicationBase throw exception on get (not on
set). New behaviour is more like MS - but most issues (unit tests)
were really path issues. Fix bug #71291.
* DateTime.cs: Add more information when throwing an exception in
ctor(long). Useful for debugging.
Modified: trunk/mcs/class/corlib/System/AppDomainSetup.cs
===================================================================
--- trunk/mcs/class/corlib/System/AppDomainSetup.cs 2005-12-09 01:17:53 UTC
(rev 54138)
+++ trunk/mcs/class/corlib/System/AppDomainSetup.cs 2005-12-09 01:18:46 UTC
(rev 54139)
@@ -1,8 +1,9 @@
//
// System.AppDomainSetup.cs
//
-// Author:
-// Dietmar Maurer ([EMAIL PROTECTED])
+// Authors:
+// Dietmar Maurer ([EMAIL PROTECTED])
+// Sebastien Pouliot <[EMAIL PROTECTED]>
//
// (C) 2001 Ximian, Inc. http://www.ximian.com
// Copyright (C) 2004-2005 Novell, Inc (http://www.novell.com)
@@ -101,14 +102,24 @@
static string GetAppBase (string appBase)
{
- if (appBase == null) return null;
+ if (appBase == null)
+ return null;
+
int len = appBase.Length;
if (len >= 8 && appBase.ToLower ().StartsWith
("file://")) {
appBase = appBase.Substring (7);
if (Path.DirectorySeparatorChar != '/')
appBase = appBase.Replace ('/',
Path.DirectorySeparatorChar);
-
- } else if (appBase.IndexOf (':') == -1) {
+ if (Environment.IsRunningOnWindows) {
+ // Under Windows prepend "//" to
indicate it's a local file
+ appBase = "//" + appBase;
+ }
+#if NET_2_0
+ } else {
+#else
+ // under 1.x the ":" gets a special treatment - but it
doesn't make sense outside Windows
+ } else if (!Environment.IsRunningOnWindows ||
(appBase.IndexOf (':') == -1)) {
+#endif
appBase = Path.GetFullPath (appBase);
}
@@ -116,12 +127,8 @@
}
public string ApplicationBase {
- get {
- return application_base;
- }
- set {
- application_base = GetAppBase (value);
- }
+ get { return GetAppBase (application_base); }
+ set { application_base = value; }
}
public string ApplicationName {
Modified: trunk/mcs/class/corlib/System/ChangeLog
===================================================================
--- trunk/mcs/class/corlib/System/ChangeLog 2005-12-09 01:17:53 UTC (rev
54138)
+++ trunk/mcs/class/corlib/System/ChangeLog 2005-12-09 01:18:46 UTC (rev
54139)
@@ -1,3 +1,11 @@
+2005-12-08 Sebastien Pouliot <[EMAIL PROTECTED]>
+
+ * AppDomainSetup.cs: ApplicationBase throw exception on get (not on
+ set). New behaviour is more like MS - but most issues (unit tests)
+ were really path issues. Fix bug #71291.
+ * DateTime.cs: Add more information when throwing an exception in
+ ctor(long). Useful for debugging.
+
2005-12-07 Zoltan Varga <[EMAIL PROTECTED]>
* Single.cs Double.cs: Fix warnings.
Modified: trunk/mcs/class/corlib/System/DateTime.cs
===================================================================
--- trunk/mcs/class/corlib/System/DateTime.cs 2005-12-09 01:17:53 UTC (rev
54138)
+++ trunk/mcs/class/corlib/System/DateTime.cs 2005-12-09 01:18:46 UTC (rev
54139)
@@ -229,11 +229,14 @@
/// Constructs a DateTime for specified ticks
/// </summary>
///
- public DateTime (long newticks)
+ public DateTime (long ticks)
{
- ticks = new TimeSpan (newticks);
- if (ticks.Ticks < MinValue.Ticks || ticks.Ticks >
MaxValue.Ticks)
- throw new ArgumentOutOfRangeException ();
+ this.ticks = new TimeSpan (ticks);
+ if (ticks < MinValue.Ticks || ticks > MaxValue.Ticks) {
+ string msg = Locale.GetText ("Value {0} is
outside the valid range [{1},{2}].",
+ ticks, MinValue.Ticks, MaxValue.Ticks);
+ throw new ArgumentOutOfRangeException ("ticks",
msg);
+ }
}
public DateTime (int year, int month, int day)
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches