2010-05-05 Gonzalo Paniagua Javier <gonzalo@novell.com>
authorGonzalo Paniagua Javier <gonzalo.mono@gmail.com>
Wed, 5 May 2010 04:08:49 +0000 (04:08 -0000)
committerGonzalo Paniagua Javier <gonzalo.mono@gmail.com>
Wed, 5 May 2010 04:08:49 +0000 (04:08 -0000)
* Path.cs: prevent infinite loop when TMPDIR (or equivalent)
points to a non-existent directory.

svn path=/trunk/mcs/; revision=156704

mcs/class/corlib/System.IO/ChangeLog
mcs/class/corlib/System.IO/Path.cs

index 9fe7abe6a28c5aae69d33cc06539e4dec1d65a4b..a3fe82ebd56a8cad7f44930aa6c028b8083294d8 100644 (file)
@@ -1,3 +1,8 @@
+2010-05-05 Gonzalo Paniagua Javier <gonzalo@novell.com>
+
+       * Path.cs: prevent infinite loop when TMPDIR (or equivalent)
+       points to a non-existent directory.
+
 2010-04-21  Sebastien Pouliot  <sebastien@ximian.com> 
 
        * FileInfo.cs: Ensure elevated trust when calling Delete on 
index 1dd4706255704a3b4e12c75dac0b901b66ecb8b6..ef234086bb91601d0c350b5ad923864ff81b4819 100644 (file)
@@ -460,6 +460,10 @@ namespace System.IO {
                                        // This can happen if we don't have write permission to /tmp
                                        throw;
                                }
+                               catch (DirectoryNotFoundException) {
+                                       // This happens when TMPDIR does not exist
+                                       throw;
+                               }
                                catch {
                                }
                        } while (f == null);