row = top - 1;
col = left - 1;
+ /* clip to the current screen bounds - msw */
+ if (row < 0)
+ row = 0;
+ if (col < 0)
+ col = 0;
+ if (left + width > SLtt_Screen_Cols)
+ width = SLtt_Screen_Cols - left;
+ if (top + height > SLtt_Screen_Rows)
+ height = SLtt_Screen_Rows - top;
n = 0;
for (j = 0; j < height + 3; j++, row++) {
SLsmg_gotorc(row, col);
SLsmg_read_raw(currentWindow->buffer + n,
- currentWindow->width + 3);
+ currentWindow->width + 3);
n += currentWindow->width + 3;
}
row = currentWindow->top - 1;
col = currentWindow->left - 1;
+ if (row < 0)
+ row = 0;
+ if (col < 0)
+ col = 0;
for (j = 0; j < currentWindow->height + 3; j++, row++) {
SLsmg_gotorc(row, col);
SLsmg_write_raw(currentWindow->buffer + n,
- currentWindow->width + 3);
+ currentWindow->width + 3);
n += currentWindow->width + 3;
}
memset(buf, ' ', SLtt_Screen_Cols);
buf[SLtt_Screen_Cols] = '\0';
- if (currentHelpline)
- memcpy(buf, *currentHelpline, strlen(*currentHelpline));
-
+ if (currentHelpline) {
+ int len = strlen(*currentHelpline);
+ if (SLtt_Screen_Cols < len)
+ len = SLtt_Screen_Cols;
+ memcpy(buf, *currentHelpline, len);
+ }
SLsmg_gotorc(SLtt_Screen_Rows - 1, 0);
SLsmg_write_string(buf);
}
Summary: A development library for text mode user interfaces.
Name: newt
-%define version 0.50.20
+%define version 0.50.21
Version: %{version}
-Release: 4
+Release: 1
Copyright: LGPL
Group: System Environment/Libraries
Source: ftp://ftp.redhat.com/pub/redhat/code/newt/newt-%{version}.tar.gz
%endif
%changelog
+* Fri Mar 30 2001 Matt Wilson <msw@redhat.com>
+- don't blow the stack if we push a help line that is longer than the
+ curret number of columns
+- clip window to screen bounds so that if we get a window that is
+ larger than the screen we can still redraw the windows behind it
+ when we pop
+
* Sun Feb 11 2001 Than Ngo <than@redhat.com>
- disable building new-python2 sub package again