nano

nano with my custom patches
git clone git://bsandro.tech/nano
Log | Files | Refs | README | LICENSE

commit 9151abcd4530fe15e9307b37132fa454127d6b4e
parent 3258bb0ff47594ee6719cf1744c88c34ef3a268a
Author: Benno Schulenberg <bensberg@telfort.nl>
Date:   Mon, 28 Oct 2019 10:28:52 +0100

tweaks: avoid setting and resetting a variable when there is no need

Diffstat:
Msrc/winio.c | 8+++-----
1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/src/winio.c b/src/winio.c @@ -2094,8 +2094,8 @@ void titlebar(const char *path) state = _("View"); else if (ISSET(RESTRICTED)) state = _("Restricted"); - - pluglen = breadth(_("Modified")) + 1; + else + pluglen = breadth(_("Modified")) + 1; } /* Determine the widths of the four elements, including their padding. */ @@ -2105,10 +2105,8 @@ void titlebar(const char *path) prefixlen++; pathlen = breadth(path); statelen = breadth(state) + 2; - if (statelen > 2) { + if (statelen > 2) pathlen++; - pluglen = 0; - } /* Only print the version message when there is room for it. */ if (verlen + prefixlen + pathlen + pluglen + statelen <= COLS)