From feb6053af9c75e8ed2daa4f9e10cb7d4e2321708 Mon Sep 17 00:00:00 2001 From: Alug Date: Thu, 31 Jul 2025 23:33:48 +0200 Subject: [PATCH] indent deez --- src/filesrch.c | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/src/filesrch.c b/src/filesrch.c index d55c33ae8..060e57d21 100644 --- a/src/filesrch.c +++ b/src/filesrch.c @@ -365,8 +365,8 @@ filestatus_t filesearch(char *filename, const char *startpath, const UINT8 *want char searchpath[1024]; size_t *searchpathindex; - dirhandle = (DIR**) malloc(maxsearchdepth * sizeof (DIR*)); - searchpathindex = (size_t *) malloc(maxsearchdepth * sizeof (size_t)); + dirhandle = (DIR**) malloc(maxsearchdepth * sizeof(DIR*)); + searchpathindex = (size_t *) malloc(maxsearchdepth * sizeof(size_t)); strcpy(searchpath,startpath); searchpathindex[--depthleft] = strlen(searchpath) + 1; @@ -410,14 +410,14 @@ filestatus_t filesearch(char *filename, const char *startpath, const UINT8 *want } // okay, now we actually want searchpath to incorporate d_name - strcpy(&searchpath[searchpathindex[depthleft]],dent->d_name); + strcpy(&searchpath[searchpathindex[depthleft]], dent->d_name); #if defined(__linux__) || defined(__FreeBSD__) - if (dent->d_type == DT_UNKNOWN && lstat(searchpath,&fsstat) == 0) + if (dent->d_type == DT_UNKNOWN && lstat(searchpath, &fsstat) == 0) { if (S_ISDIR(fsstat.st_mode)) dent->d_type = DT_DIR; - else if (S_ISLNK(fsstat.st_mode)) + else if (S_ISLNK(fsstat.st_mode)) dent->d_type = DT_LNK; } @@ -439,11 +439,12 @@ filestatus_t filesearch(char *filename, const char *startpath, const UINT8 *want { searchpathindex[--depthleft] = strlen(searchpath) + 1; dirhandle[depthleft] = opendir(searchpath); + if (!dirhandle[depthleft]) { - // can't open it... maybe no read-permissions - // go back to previous dir - depthleft++; + // can't open it... maybe no read-permissions + // go back to previous dir + depthleft++; } searchpath[searchpathindex[depthleft]-1] = PATHSEP[0]; @@ -455,9 +456,9 @@ filestatus_t filesearch(char *filename, const char *startpath, const UINT8 *want { case FS_FOUND: if (completepath) - strcpy(filename,searchpath); + strcpy(filename, searchpath); else - strcpy(filename,dent->d_name); + strcpy(filename, dent->d_name); retval = FS_FOUND; found = 1; break;