From caa86591f4ecd61d743785d134a3d4feee3d5fa0 Mon Sep 17 00:00:00 2001 From: David Lawrence Ramsey Date: Sun, 10 Jul 2005 23:57:32 +0000 Subject: [PATCH] *really* fix titlebar() git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2846 35c25a1d-7b9e-4130-9fde-d3aeb78583b8 --- src/winio.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/winio.c b/src/winio.c index e5fe6320..e9470517 100644 --- a/src/winio.c +++ b/src/winio.c @@ -2755,7 +2755,7 @@ void titlebar(const char *path) * buffer. */ size_t statelen = 0; /* The length of the state in columns, or the length of - * "Modified" if the state is blank. */ + * "Modified" if the state is blank, plus one for padding. */ char *exppath = NULL; /* The file name, expanded for display. */ bool newfie = FALSE; @@ -2785,7 +2785,6 @@ void titlebar(const char *path) /* Add one space after the version message, and account for both it * and the two spaces before it. */ mvwaddnstr(topwin, 0, 2, VERMSG, actual_x(VERMSG, verlen)); - waddch(topwin, ' '); verlen += 3; /* Account for the full length of the version message. */ @@ -2801,7 +2800,7 @@ void titlebar(const char *path) state = openfile->modified ? _("Modified") : ISSET(VIEW_MODE) ? _("View") : ""; - statelen = strlenpt((state[0] != '\0') ? state : _("Modified")); + statelen = strlenpt((state[0] != '\0') ? state : _("Modified")) + 1; /* If possible, add a space before state. */ if (space > 0 && statelen < space) @@ -2885,9 +2884,8 @@ void titlebar(const char *path) if (COLS <= 1 || statelen >= COLS - 1) mvwaddnstr(topwin, 0, 0, state, actual_x(state, COLS)); else { - assert(COLS - statelen - 2 >= 0); + assert(COLS - statelen - 1 >= 0); - mvwaddch(topwin, 0, COLS - statelen - 2, ' '); mvwaddnstr(topwin, 0, COLS - statelen - 1, state, actual_x(state, statelen)); }