6a42c97
--- texinfo-4.11/info/window.c_old	2007-07-01 23:20:31.000000000 +0200
6a42c97
+++ texinfo-4.11/info/window.c	2007-11-13 10:52:44.000000000 +0100
6a42c97
@@ -1,5 +1,5 @@
6a42c97
 /* window.c -- windows in Info.
6a42c97
-   $Id: texinfo-4.11-res_win_segfault.patch,v 1.1 2007/11/13 10:51:28 vcrhonek Exp $
6a42c97
+   $Id: texinfo-4.11-res_win_segfault.patch,v 1.1 2007/11/13 10:51:28 vcrhonek Exp $
6a42c97
 
6a42c97
    Copyright (C) 1993, 1997, 1998, 2001, 2002, 2003, 2004, 2007
6a42c97
    Free Software Foundation, Inc.
6a42c97
@@ -249,9 +249,22 @@
6a42c97
               break;
6a42c97
             }
6a42c97
           else
6a42c97
-            win= win->next;
6a42c97
+            win = win->next;
6a42c97
         }
6a42c97
     }
6a42c97
+
6a42c97
+  /* One more loop.  If any heights or widths have become negative,
6a42c97
+     set them to zero.  This can apparently happen with resizing down to
6a42c97
+     very small sizes.  Sadly, it is not apparent to me where in the
6a42c97
+     above calculations it goes wrong.  */
6a42c97
+  for (win = windows; win; win = win->next)
6a42c97
+    {
6a42c97
+      if (win->height < 0)
6a42c97
+        win->height = 0;
6a42c97
+
6a42c97
+      if (win->width < 0)
6a42c97
+        win->width = 0;
6a42c97
+    }
6a42c97
 }
6a42c97
 
6a42c97
 /* Make a new window showing NODE, and return that window structure.
6a42c97
--- texinfo-4.11/info/display.c_old	2007-07-01 23:20:29.000000000 +0200
6a42c97
+++ texinfo-4.11/info/display.c	2007-11-13 10:53:58.000000000 +0100
6a42c97
@@ -1,5 +1,5 @@
6a42c97
 /* display.c -- How to display Info windows.
6a42c97
-   $Id: texinfo-4.11-res_win_segfault.patch,v 1.1 2007/11/13 10:51:28 vcrhonek Exp $
6a42c97
+   $Id: texinfo-4.11-res_win_segfault.patch,v 1.1 2007/11/13 10:51:28 vcrhonek Exp $
6a42c97
 
6a42c97
    Copyright (C) 1993, 1997, 2003, 2004, 2006, 2007
6a42c97
    Free Software Foundation, Inc.
6a42c97
@@ -136,8 +136,13 @@
6a42c97
   if (display_inhibited)
6a42c97
     display_was_interrupted_p = 1;
6a42c97
 
6a42c97
-  /* If the window has no height, or display is inhibited, quit now. */
6a42c97
-  if (!win->height || display_inhibited)
6a42c97
+  /* If the window has no height, or display is inhibited, quit now.
6a42c97
+     Strictly speaking, it should only be necessary to test if the
6a42c97
+     values are equal to zero, since window_new_screen_size should
6a42c97
+     ensure that the window height/width never becomes negative, but
6a42c97
+     since historically this has often been the culprit for crashes, do
6a42c97
+     our best to be doubly safe.  */
6a42c97
+  if (win->height <= 0 || win->width <= 0 || display_inhibited)
6a42c97
     return;
6a42c97
 
6a42c97
   /* If the window's first row doesn't appear in the_screen, then it