console: allow scrollback-buffer maximum = 0

The scrollback buffer has a variable maximum of lines which can be set
by the application. We currently require it to be greater than 0. This
allows sb_max to be 0 so we can have a console buffer without a
scroll-back buffer.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
This commit is contained in:
David Herrmann committed 2012-02-02 16:30:18 +01:00
1 parent fb14273bf7
commit 54a552b852
1 file changed
+5
+5
View File
@@ -278,6 +278,11 @@ static void link_to_scrollback(struct kmscon_buffer *buf, struct line *line)
if (!buf || !line)
return;
if (buf->sb_max == 0) {
free_line(line);
return;
}
if (buf->sb_count >= buf->sb_max) {
tmp = buf->sb_first;
buf->sb_first = tmp->next;