Author: gnorton
Date: 2008-01-22 12:17:47 -0500 (Tue, 22 Jan 2008)
New Revision: 93550

Modified:
   trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
   trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Mime.cs
Log:
In .:
2008-01-22 Geoff Norton  <[EMAIL PROTECTED]>

        * Mime.cs:  Avoid a needles exception on OSX if we dont have a buffer
        acquired.  Also ensure the buffer is large enough to grab the header
        we need on linux boxes.



Modified: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog        
2008-01-22 16:57:33 UTC (rev 93549)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog        
2008-01-22 17:17:47 UTC (rev 93550)
@@ -1,3 +1,9 @@
+2008-01-22 Geoff Norton  <[EMAIL PROTECTED]>
+
+       * Mime.cs:  Avoid a needles exception on OSX if we dont have a buffer
+       acquired.  Also ensure the buffer is large enough to grab the header
+       we need on linux boxes.
+
 2008-01-22  Jonathan Pobst  <[EMAIL PROTECTED]>
 
        * Control.cs: Implement a custom enumerator so people can delete

Modified: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Mime.cs
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Mime.cs  
2008-01-22 16:57:33 UTC (rev 93549)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Mime.cs  
2008-01-22 17:17:47 UTC (rev 93550)
@@ -123,7 +123,7 @@
                        FDOMimeConfigReader fmcr = new FDOMimeConfigReader ();
                        int buffer_length = fmcr.Init ();
                        
-                       if (buffer_length != -1) {
+                       if (buffer_length >= 32) {
                                buffer = new byte [buffer_length];
                                mime_available = true;
                        }
@@ -245,7 +245,7 @@
                private void GoByFileName ()
                {
                        // check if we can open the file
-                       if (!OpenFile ()) {
+                       if (!MimeAvailable || !OpenFile ()) {
                                // couldn't open the file, check globals only
                                CheckGlobalPatterns ();
                                

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to