diff --git a/src/d_netfil.c b/src/d_netfil.c index 8a37a2dac..356fb6854 100644 --- a/src/d_netfil.c +++ b/src/d_netfil.c @@ -1179,7 +1179,7 @@ filestatus_t findfile(char *filename, const UINT8 *wantedmd5sum, boolean complet if (cv_addons_option.value == 3 && *cv_addons_folder.string != '\0') { // first, check any custom directory if specified - homecheck = filesearch(filename, cv_addons_folder.string, wantedmd5sum, completepath, 10, false); + homecheck = filesearch(filename, cv_addons_folder.string, wantedmd5sum, completepath, 10); if (homecheck == FS_FOUND) // we found the file, so return that we have :) return FS_FOUND; @@ -1189,7 +1189,7 @@ filestatus_t findfile(char *filename, const UINT8 *wantedmd5sum, boolean complet } // next, check "DOWNLOAD" directory - homecheck = filesearch(filename, "DOWNLOAD", wantedmd5sum, completepath, 10, false); + homecheck = filesearch(filename, "DOWNLOAD", wantedmd5sum, completepath, 10); if (homecheck == FS_FOUND) // we found the file, so return that we have :) return FS_FOUND; @@ -1198,7 +1198,7 @@ filestatus_t findfile(char *filename, const UINT8 *wantedmd5sum, boolean complet // if not found at all, just move on without doing anything // next, check "addons" directory - homecheck = filesearch(filename, "addons", wantedmd5sum, completepath, 10, false); + homecheck = filesearch(filename, "addons", wantedmd5sum, completepath, 10); if (homecheck == FS_FOUND) // we found the file, so return that we have :) return FS_FOUND; @@ -1208,7 +1208,7 @@ filestatus_t findfile(char *filename, const UINT8 *wantedmd5sum, boolean complet } // next, check SRB2's "home" directory - homecheck = filesearch(filename, srb2home, wantedmd5sum, completepath, 10, true); + homecheck = filesearch(filename, srb2home, wantedmd5sum, completepath, 10); if (homecheck == FS_FOUND) // we found the file, so return that we have :) return FS_FOUND; @@ -1217,7 +1217,7 @@ filestatus_t findfile(char *filename, const UINT8 *wantedmd5sum, boolean complet // if not found at all, just move on without doing anything // next, check SRB2's "path" directory - homecheck = filesearch(filename, srb2path, wantedmd5sum, completepath, 10, true); + homecheck = filesearch(filename, srb2path, wantedmd5sum, completepath, 10); if (homecheck == FS_FOUND) // we found the file, so return that we have :) return FS_FOUND; @@ -1226,7 +1226,7 @@ filestatus_t findfile(char *filename, const UINT8 *wantedmd5sum, boolean complet // if not found at all, just move on without doing anything // finally check "." directory - homecheck = filesearch(filename, ".", wantedmd5sum, completepath, 10, true); + homecheck = filesearch(filename, ".", wantedmd5sum, completepath, 10); if (homecheck != FS_NOTFOUND) // if not found this time, fall back on the below return statement return homecheck; // otherwise return the result we got diff --git a/src/dedicated/i_system.c b/src/dedicated/i_system.c index f33190ec5..b2affd674 100644 --- a/src/dedicated/i_system.c +++ b/src/dedicated/i_system.c @@ -1862,7 +1862,7 @@ static const char *searchWad(const char *searchDir) filestatus_t fstemp; strcpy(tempsw, WADKEYWORD1); - fstemp = filesearch(tempsw, searchDir, NULL, true, 20, true); + fstemp = filesearch(tempsw, searchDir, NULL, true, 20); if (fstemp == FS_FOUND) { pathonly(tempsw); @@ -1870,7 +1870,7 @@ static const char *searchWad(const char *searchDir) } strcpy(tempsw, WADKEYWORD2); - fstemp = filesearch(tempsw, searchDir, NULL, true, 20, true); + fstemp = filesearch(tempsw, searchDir, NULL, true, 20); if (fstemp == FS_FOUND) { pathonly(tempsw); diff --git a/src/filesrch.c b/src/filesrch.c index 2e344be9b..32b307923 100644 --- a/src/filesrch.c +++ b/src/filesrch.c @@ -391,7 +391,7 @@ static const char *exclude_paths[] = { }; #endif -filestatus_t filesearch(char *filename, const char *startpath, const UINT8 *wantedmd5sum, boolean completepath, int maxsearchdepth, boolean skipexclude) +filestatus_t filesearch(char *filename, const char *startpath, const UINT8 *wantedmd5sum, boolean completepath, int maxsearchdepth) { filestatus_t retval = FS_NOTFOUND; DIR **dirhandle; @@ -404,7 +404,7 @@ filestatus_t filesearch(char *filename, const char *startpath, const UINT8 *want int depthleft = maxsearchdepth; char searchpath[1024]; size_t *searchpathindex; - boolean folderchanged = true; + boolean folderchanged = true; // tells us if we changed folders during traversal dirhandle = (DIR**)malloc(maxsearchdepth * sizeof(DIR*)); searchpathindex = (size_t *)malloc(maxsearchdepth * sizeof(size_t)); @@ -453,7 +453,7 @@ filestatus_t filesearch(char *filename, const char *startpath, const UINT8 *want } // skip some folders that wont have addons in them - if (skipexclude && folderchanged) + if (folderchanged) { boolean skipfolder = false; @@ -500,7 +500,6 @@ filestatus_t filesearch(char *filename, const char *startpath, const UINT8 *want } // Linux and FreeBSD has a special field for file type on dirent, so use that to speed up lookups. - // FIXME: should we also follow symlinks? if ((dent->d_type == DT_DIR && depthleft) || (dent->d_type == DT_LNK && depthleft)) #elif defined (_WIN32) // if we wanna follow symlinks we can check with FILE_ATTRIBUTE_REPARSE_POINT diff --git a/src/filesrch.h b/src/filesrch.h index d2cba7272..697020c54 100644 --- a/src/filesrch.h +++ b/src/filesrch.h @@ -24,14 +24,13 @@ extern consvar_t cv_addons_option, cv_addons_folder, cv_addons_md5, cv_addons_sh \param wantedmd5sum want to check with MD5 \param completepath want to return the complete path of the file? \param maxsearchdepth the max depth to search for the file - \param skipexclude when true this skips certain named folders \return filestatus_t */ -filestatus_t filesearch(char *filename, const char *startpath, const UINT8 *wantedmd5sum, boolean completepath, int maxsearchdepth, boolean skipexclude); +filestatus_t filesearch(char *filename, const char *startpath, const UINT8 *wantedmd5sum, boolean completepath, int maxsearchdepth); #define menudepth 20 diff --git a/src/sdl/i_system.cpp b/src/sdl/i_system.cpp index ffd83b1f1..9e0697cfe 100644 --- a/src/sdl/i_system.cpp +++ b/src/sdl/i_system.cpp @@ -2467,7 +2467,7 @@ static const char *searchWad(const char *searchDir) filestatus_t fstemp; strcpy(tempsw, WADKEYWORD1); - fstemp = filesearch(tempsw, searchDir, NULL, true, 20, true); + fstemp = filesearch(tempsw, searchDir, NULL, true, 20); if (fstemp == FS_FOUND) { pathonly(tempsw); diff --git a/src/sdl/i_ttf.c b/src/sdl/i_ttf.c index ebfc50d4a..f2cd497ee 100644 --- a/src/sdl/i_ttf.c +++ b/src/sdl/i_ttf.c @@ -58,7 +58,7 @@ static char *searchFont(const char *fontsearchDir) filestatus_t fstemp; strcpy(tempsw, FONTFILE); - fstemp = filesearch(tempsw, fontsearchDir, NULL, true, 20, true); + fstemp = filesearch(tempsw, fontsearchDir, NULL, true, 20); if (fstemp == FS_FOUND) { return tempsw;