#include <readline/readline.h>
#ifndef MALLOC_INCOMPATIBLE
+--- gdb-5.1.1/gdb/tui/tuiWin.c.orig Sat Jul 28 21:30:54 2001
++++ gdb-5.1.1/gdb/tui/tuiWin.c Sat Feb 2 15:19:33 2002
+@@ -619,10 +619,10 @@
+ tuiResizeAll (void)
+ {
+ int heightDiff, widthDiff;
+- extern int screenheight, screenwidth; /* in readline */
++ extern int _rl_screenheight, _rl_screenwidth; /* in readline */
+
+- widthDiff = screenwidth - termWidth ();
+- heightDiff = screenheight - termHeight ();
++ widthDiff = _rl_screenwidth - termWidth ();
++ heightDiff = _rl_screenheight - termHeight ();
+ if (heightDiff || widthDiff)
+ {
+ TuiLayoutType curLayout = currentLayout ();
+@@ -636,8 +636,8 @@
+ if (winWithFocus != cmdWin)
+ keypad (cmdWin->generic.handle, FALSE);
+ init_page_info ();
+- setTermHeightTo (screenheight);
+- setTermWidthTo (screenwidth);
++ setTermHeightTo (_rl_screenheight);
++ setTermWidthTo (_rl_screenwidth);
+ if (curLayout == SRC_DISASSEM_COMMAND ||
+ curLayout == SRC_DATA_COMMAND || curLayout == DISASSEM_DATA_COMMAND)
+ numWinsDisplayed++;
+@@ -664,8 +664,8 @@
+ if (heightDiff == 0)
+ newHeight = firstWin->generic.height;
+ else if ((firstWin->generic.height + splitDiff) >=
+- (screenheight - MIN_CMD_WIN_HEIGHT - 1))
+- newHeight = screenheight - MIN_CMD_WIN_HEIGHT - 1;
++ (_rl_screenheight - MIN_CMD_WIN_HEIGHT - 1))
++ newHeight = _rl_screenheight - MIN_CMD_WIN_HEIGHT - 1;
+ else if ((firstWin->generic.height + splitDiff) <= 0)
+ newHeight = MIN_WIN_HEIGHT;
+ else
+@@ -674,7 +674,7 @@
+ _makeInvisibleAndSetNewHeight (firstWin, newHeight);
+ cmdWin->generic.origin.y = locator->origin.y + 1;
+ cmdWin->generic.width += widthDiff;
+- newHeight = screenheight - cmdWin->generic.origin.y;
++ newHeight = _rl_screenheight - cmdWin->generic.origin.y;
+ _makeInvisibleAndSetNewHeight (cmdWin, newHeight);
+ _makeVisibleWithNewHeight (firstWin);
+ _makeVisibleWithNewHeight (cmdWin);
+@@ -702,8 +702,8 @@
+ newHeight = firstWin->generic.height;
+ else if ((firstWin->generic.height +
+ secondWin->generic.height + (splitDiff * 2)) >=
+- (screenheight - MIN_CMD_WIN_HEIGHT - 1))
+- newHeight = (screenheight - MIN_CMD_WIN_HEIGHT - 1) / 2;
++ (_rl_screenheight - MIN_CMD_WIN_HEIGHT - 1))
++ newHeight = (_rl_screenheight - MIN_CMD_WIN_HEIGHT - 1) / 2;
+ else if ((firstWin->generic.height + splitDiff) <= 0)
+ newHeight = MIN_WIN_HEIGHT;
+ else
+@@ -722,9 +722,9 @@
+ newHeight = secondWin->generic.height;
+ else if ((firstWin->generic.height +
+ secondWin->generic.height + (splitDiff * 2)) >=
+- (screenheight - MIN_CMD_WIN_HEIGHT - 1))
++ (_rl_screenheight - MIN_CMD_WIN_HEIGHT - 1))
+ {
+- newHeight = screenheight - MIN_CMD_WIN_HEIGHT - 1;
++ newHeight = _rl_screenheight - MIN_CMD_WIN_HEIGHT - 1;
+ if (newHeight % 2)
+ newHeight = (newHeight / 2) + 1;
+ else