From 7255c6b0342b89713a02a9cb8f0aa3a6723466e6 Mon Sep 17 00:00:00 2001 From: Sam Hocevar Date: Thu, 26 Oct 2006 09:17:21 +0000 Subject: [PATCH] * Allow to import empty files or files with only empty lines. --- cucul/import.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/cucul/import.c b/cucul/import.c index 8c64d7e..699df1a 100644 --- a/cucul/import.c +++ b/cucul/import.c @@ -233,6 +233,9 @@ static cucul_canvas_t *import_text(void const *data, unsigned int size) x++; } + if(y > height) + cucul_set_canvas_size(cv, width, height = y); + return cv; } @@ -431,6 +434,12 @@ static cucul_canvas_t *import_ansi(void const *data, unsigned int size, x += wch; } + if((unsigned int)y > height) + { + cucul_set_color(cv, CUCUL_COLOR_DEFAULT, CUCUL_COLOR_TRANSPARENT); + cucul_set_canvas_size(cv, width, height = y); + } + return cv; }