sfm

simple file manager
git clone git://git.afify.dev/sfm
Log | Files | Refs | README | LICENSE

commit e743468348fa556a8941c98e2f4281a971388b42
parent 20f1dd6501f3414ff3128511bffe37cb856a7bac
Author: afify <hassan@afify.dev>
Date:   Sun, 13 Dec 2020 09:23:28 +0300

[feat] support strcasestr in filter

Diffstat:
Msfm.c | 7+++++--
1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/sfm.c b/sfm.c @@ -1,5 +1,8 @@ /* See LICENSE file for copyright and license details. */ +#if defined(__linux__) +#define _GNU_SOURCE +#endif #include <sys/types.h> #include <sys/resource.h> #include <sys/stat.h> @@ -1784,7 +1787,7 @@ set_direntr(struct dirent *entry, DIR *dir, char *filter) continue; if (filter != NULL) { - if (strstr(entry->d_name, filter) != NULL) { + if (strcasestr(entry->d_name, filter) != NULL) { ADD_ENTRY } } @@ -1816,7 +1819,7 @@ listdir(int hi, char *filter) /* get content and filter sum */ while ((entry = readdir(dir)) != 0) { if (filter != NULL) { - if (strstr(entry->d_name, filter) != NULL) + if (strcasestr(entry->d_name, filter) != NULL) filtercount++; } else { /* no filter */ cpane->dirc++;