Author: bonefish Date: 2010-02-24 15:08:54 +0100 (Wed, 24 Feb 2010) New Revision: 35599 Changeset: http://dev.haiku-os.org/changeset/35599/haiku Ticket: http://dev.haiku-os.org/ticket/3440 Modified: haiku/trunk/src/apps/terminal/BasicTerminalBuffer.cpp Log: 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. Modified: haiku/trunk/src/apps/terminal/BasicTerminalBuffer.cpp =================================================================== --- haiku/trunk/src/apps/terminal/BasicTerminalBuffer.cpp 2010-02-24 14:06:40 UTC (rev 35598) +++ haiku/trunk/src/apps/terminal/BasicTerminalBuffer.cpp 2010-02-24 14:08:54 UTC (rev 35599) @@ -1,5 +1,5 @@ /* - * Copyright 2008, Ingo Weinhold, ingo_weinhold@xxxxxxx + * Copyright 2008-2010, Ingo Weinhold, ingo_weinhold@xxxxxxx * Distributed under the terms of the MIT License. */ @@ -20,7 +20,14 @@ 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) \ + sizeof(TerminalCell) * ((width) - 1))) @@ -164,8 +171,8 @@ 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; }