From 54a552b852ba74f91acf46331b64c310eb907433 Mon Sep 17 00:00:00 2001 From: David Herrmann Date: Thu, 2 Feb 2012 16:30:18 +0100 Subject: [PATCH] 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 --- src/console_cell.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/console_cell.c b/src/console_cell.c index 0c1cc2f..d10d3d1 100644 --- a/src/console_cell.c +++ b/src/console_cell.c @@ -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;