nano

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

commit 7b935e0d40df568d385c3e53076aefe17c14a30c
parent 7034c3cc4727f808259aa8eecdcf8e7024663d32
Author: Benno Schulenberg <bensberg@telfort.nl>
Date:   Sun, 11 Sep 2022 11:57:11 +0200

tweaks: elide an intermediary variable that is no longer needed

Diffstat:
Msrc/browser.c | 7+------
1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/src/browser.c b/src/browser.c @@ -261,8 +261,6 @@ void findfile(const char *needle, bool forwards) { size_t looking_at = selected; /* The location in the file list of the filename we're looking at. */ - const char *thename; - /* The plain filename, without the path. */ /* Step through each filename in the list until a match is found or * we've come back to the point where we started. */ @@ -279,12 +277,9 @@ void findfile(const char *needle, bool forwards) } } - /* Get the bare filename, without the path. */ - thename = tail(filelist[looking_at]); - /* If the needle matches, we're done. And if we're back at the file * where we started, it is the only occurrence. */ - if (mbstrcasestr(thename, needle)) { + if (mbstrcasestr(tail(filelist[looking_at]), needle)) { if (looking_at == selected) statusbar(_("This is the only occurrence")); break;