tweaks: reword and/or condense four comments
This commit is contained in:
parent
358a10e3cc
commit
8198fd9c58
@ -255,13 +255,12 @@ void browser_refresh(void)
|
|||||||
wnoutrefresh(midwin);
|
wnoutrefresh(midwin);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Look for the given needle in the list of files. If forwards is TRUE,
|
/* Look for the given needle in the list of files, forwards or backwards. */
|
||||||
* search forward in the list; otherwise, search backward. */
|
|
||||||
void findfile(const char *needle, bool forwards)
|
void findfile(const char *needle, bool forwards)
|
||||||
{
|
{
|
||||||
size_t began_at = selected;
|
size_t began_at = selected;
|
||||||
|
|
||||||
/* Step through each filename in the list until a match is found or
|
/* Iterate through the list of filenames, until a match is found or
|
||||||
* we've come back to the point where we started. */
|
* we've come back to the point where we started. */
|
||||||
while (TRUE) {
|
while (TRUE) {
|
||||||
if (forwards) {
|
if (forwards) {
|
||||||
@ -276,15 +275,14 @@ void findfile(const char *needle, bool forwards)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* If the needle matches, we're done. And if we're back at the file
|
/* When the needle occurs in the basename of the file, we have a match. */
|
||||||
* where we started, it is the only occurrence. */
|
|
||||||
if (mbstrcasestr(tail(filelist[selected]), needle)) {
|
if (mbstrcasestr(tail(filelist[selected]), needle)) {
|
||||||
if (selected == began_at)
|
if (selected == began_at)
|
||||||
statusbar(_("This is the only occurrence"));
|
statusbar(_("This is the only occurrence"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* If we're back at the beginning and didn't find any match... */
|
/* When we're back at the starting point without any match... */
|
||||||
if (selected == began_at) {
|
if (selected == began_at) {
|
||||||
not_found_msg(needle);
|
not_found_msg(needle);
|
||||||
return;
|
return;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user