nano

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

commit f6b396f20639be7eaec75fe3d799d77fc9c067e6
parent 5561d22f19b8ec671f514f5daae7e9a3a2491502
Author: Benno Schulenberg <bensberg@telfort.nl>
Date:   Tue, 19 Sep 2017 21:14:05 +0200

tweaks: chuck an assert, and then condense the code and a comment

Diffstat:
Msrc/search.c | 13+++----------
1 file changed, 3 insertions(+), 10 deletions(-)

diff --git a/src/search.c b/src/search.c @@ -65,21 +65,14 @@ void regexp_cleanup(void) } } -/* Indicate on the statusbar that the string at str was not found by the - * last search. */ +/* Report on the status bar that the given string was not found. */ void not_found_msg(const char *str) { - char *disp; - size_t numchars; - - assert(str != NULL); - - disp = display_string(str, 0, (COLS / 2) + 1, FALSE); - numchars = actual_x(disp, strnlenpt(disp, COLS / 2)); + char *disp = display_string(str, 0, (COLS / 2) + 1, FALSE); + size_t numchars = actual_x(disp, strnlenpt(disp, COLS / 2)); statusline(HUSH, _("\"%.*s%s\" not found"), numchars, disp, (disp[numchars] == '\0') ? "" : "..."); - free(disp); }