From 4b31579af880a5442699fb93f30e0b3127d37c57 Mon Sep 17 00:00:00 2001 From: nion Date: Thu, 17 Mar 2005 14:39:44 +0000 Subject: [PATCH] Nico Golde: - fixed segfault (if the sidebar delimiter is longer than sidebar width) - | will be shown as nice ACS_VLINE, if ascii_chars is not set git-svn-id: svn://svn.berlios.de/mutt-ng/trunk@188 e385b8ad-14ed-0310-8656-cc95a2468c6d --- sidebar.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/sidebar.c b/sidebar.c index 4a648aa..7d5ab23 100644 --- a/sidebar.c +++ b/sidebar.c @@ -227,6 +227,12 @@ int draw_sidebar(int menu) { BUFFY *tmp; short delim_len = mutt_strlen (SidebarDelim); + if(strlen(SidebarDelim)>=SidebarWidth){ + mutt_endwin(NULL); + printf("Your sidebar delimiter string is longer (or as long as) than the sidebar width. Make it shorter! \n"); + exit(1); + } + /* initialize first time */ if(!initialized) { prev_show_value = option(OPTMBOXPANE); @@ -256,7 +262,14 @@ int draw_sidebar(int menu) { for (lines = 1; lines < LINES-1-(menu != MENU_PAGER || option (OPTSTATUSONTOP)); lines++ ) { move(lines, SidebarWidth - delim_len); - addstr (NONULL (SidebarDelim)); + if (option (OPTASCIICHARS)) + addstr (NONULL (SidebarDelim)); + else if(!option(OPTASCIICHARS) && !strcmp(SidebarDelim,"|")) + addch(ACS_VLINE); + else if ((Charset_is_utf8) && !strcmp(SidebarDelim, "|")) + addstr ("\342\224\202"); + else + addstr (NONULL (SidebarDelim)); } SETCOLOR(MT_COLOR_NORMAL); -- 2.20.1