BasicTerminalBuffer::ResizeTo(): Introduced laxer buffer size limits than

the terminal size limits defined in TermConst.h. Fixes #3440, although the
main cause -- the incorrect computation of the window size limits -- still
exists.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35599 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Ingo Weinhold 2010-02-24 14:08:54 +00:00
parent 6ba976d9f8
commit c35b7b937b

View File

@ -1,5 +1,5 @@
/*
* Copyright 2008, Ingo Weinhold, ingo_weinhold@gmx.de.
* Copyright 2008-2010, Ingo Weinhold, ingo_weinhold@gmx.de.
* Distributed under the terms of the MIT License.
*/
@ -20,6 +20,13 @@
static const UTF8Char kSpaceChar(' ');
// Soft size limits for the terminal buffer. The constants defined in
// TermConst.h are rather for the Terminal in general (i.e. the GUI).
static const int32 kMinRowCount = 2;
static const int32 kMaxRowCount = 1024;
static const int32 kMinColumnCount = 4;
static const int32 kMaxColumnCount = 1024;
#define ALLOC_LINE_ON_STACK(width) \
((TerminalLine*)alloca(sizeof(TerminalLine) \
@ -164,8 +171,8 @@ BasicTerminalBuffer::ResizeTo(int32 width, int32 height)
status_t
BasicTerminalBuffer::ResizeTo(int32 width, int32 height, int32 historyCapacity)
{
if (height < MIN_ROWS || height > MAX_ROWS || width < MIN_COLS
|| width > MAX_COLS) {
if (height < kMinRowCount || height > kMaxRowCount
|| width < kMinColumnCount || width > kMaxColumnCount) {
return B_BAD_VALUE;
}