From b68cc3cd3cf63a3e0dd6a96d3eab7fad4c5bacf0 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Tue, 26 Feb 2013 18:53:29 +0100 Subject: [PATCH] NCurses: fix unneeded last line when displaying info box --- src/ncurses.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/ncurses.cc b/src/ncurses.cc index 2b7da02c..1570b75e 100644 --- a/src/ncurses.cc +++ b/src/ncurses.cc @@ -398,6 +398,10 @@ static DisplayCoord compute_needed_size(const String& str) { if (*begin == '\n') { + // ignore last '\n', no need to show an empty line + if (begin+1 == end) + break; + res.column = std::max(res.column, line_len+1); line_len = 0; ++res.line;