From: David Lawrence Ramsey Date: Sun, 2 Jul 2006 17:00:07 +0000 (+0000) Subject: in browser_init(), fix off-by-one error when calculating longest that X-Git-Tag: v1.9.99pre1~144 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=c021925abbd42aee27ad2e5e959631766028c44f;p=nano.git in browser_init(), fix off-by-one error when calculating longest that kept the rightmost column of the screen from being used git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3717 35c25a1d-7b9e-4130-9fde-d3aeb78583b8 --- diff --git a/ChangeLog b/ChangeLog index c9921243..5bda5842 100644 --- a/ChangeLog +++ b/ChangeLog @@ -17,6 +17,9 @@ CVS code - - After entering "..", select the directory we were in before instead of the first filename in the list, as Pico does. (DLR) - Simplify screen update handling and exiting. (DLR) + browser_init() + - Fix off-by-one error when calculating longest that kept the + rightmost column of the screen from being used. (DLR) browser_refresh() - Simplify. (DLR) - Fix problems where translated versions of "(dir)" could be diff --git a/src/browser.c b/src/browser.c index c279612d..dece9ed4 100644 --- a/src/browser.c +++ b/src/browser.c @@ -466,7 +466,7 @@ void browser_init(const char *path, DIR *dir) i++; - d_len = strlenpt(nextdir->d_name); + d_len = strlenpt(nextdir->d_name) + 1; if (d_len > longest) longest = (d_len > COLS - 1) ? COLS - 1 : d_len; }