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:
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2008, Ingo Weinhold, [email protected].
|
* Copyright 2008-2010, Ingo Weinhold, [email protected].
|
||||||
* Distributed under the terms of the MIT License.
|
* Distributed under the terms of the MIT License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@@ -20,6 +20,13 @@
|
|||||||
|
|
||||||
static const UTF8Char kSpaceChar(' ');
|
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) \
|
#define ALLOC_LINE_ON_STACK(width) \
|
||||||
((TerminalLine*)alloca(sizeof(TerminalLine) \
|
((TerminalLine*)alloca(sizeof(TerminalLine) \
|
||||||
@@ -164,8 +171,8 @@ BasicTerminalBuffer::ResizeTo(int32 width, int32 height)
|
|||||||
status_t
|
status_t
|
||||||
BasicTerminalBuffer::ResizeTo(int32 width, int32 height, int32 historyCapacity)
|
BasicTerminalBuffer::ResizeTo(int32 width, int32 height, int32 historyCapacity)
|
||||||
{
|
{
|
||||||
if (height < MIN_ROWS || height > MAX_ROWS || width < MIN_COLS
|
if (height < kMinRowCount || height > kMaxRowCount
|
||||||
|| width > MAX_COLS) {
|
|| width < kMinColumnCount || width > kMaxColumnCount) {
|
||||||
return B_BAD_VALUE;
|
return B_BAD_VALUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user