Author: gonzalo
Date: 2005-05-06 20:09:11 -0400 (Fri, 06 May 2005)
New Revision: 44180
Modified:
trunk/mcs/class/corlib/System.IO/ChangeLog
trunk/mcs/class/corlib/System.IO/Directory.cs
Log:
2005-05-06 Gonzalo Paniagua Javier <[EMAIL PROTECTED]>
* Directory.cs: if the pattern is just a file name and it exists, return
it right away. Fixes bug #72143.
Modified: trunk/mcs/class/corlib/System.IO/ChangeLog
===================================================================
--- trunk/mcs/class/corlib/System.IO/ChangeLog 2005-05-06 23:37:58 UTC (rev
44179)
+++ trunk/mcs/class/corlib/System.IO/ChangeLog 2005-05-07 00:09:11 UTC (rev
44180)
@@ -1,3 +1,8 @@
+2005-05-06 Gonzalo Paniagua Javier <[EMAIL PROTECTED]>
+
+ * Directory.cs: if the pattern is just a file name and it exists, return
+ it right away. Fixes bug #72143.
+
2005-05-06 Ben Maurer <[EMAIL PROTECTED]>
* File.cs (Open): If a stream is opened with Append access, you
Modified: trunk/mcs/class/corlib/System.IO/Directory.cs
===================================================================
--- trunk/mcs/class/corlib/System.IO/Directory.cs 2005-05-06 23:37:58 UTC
(rev 44179)
+++ trunk/mcs/class/corlib/System.IO/Directory.cs 2005-05-07 00:09:11 UTC
(rev 44180)
@@ -413,6 +413,13 @@
MonoIOError error;
if (!MonoIO.ExistsDirectory (wildpath, out error)) {
+ if (error == MonoIOError.ERROR_SUCCESS) {
+ MonoIOError file_error;
+ if (MonoIO.ExistsFile (wildpath, out
file_error)) {
+ return new string [] { wildpath
};
+ }
+ }
+
if (error != MonoIOError.ERROR_PATH_NOT_FOUND)
throw MonoIO.GetException (wildpath,
error);
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches