mirror of
https://github.com/openmoh/openmohaa.git
synced 2025-04-28 21:57:57 +03:00
Exclude the slash at the beginning of each file for FS_ListFilteredFiles
This commit is contained in:
parent
4f699f3b58
commit
b5a73384d3
2 changed files with 9 additions and 2 deletions
|
@ -2367,6 +2367,9 @@ char **FS_ListFilteredFiles( const char *path, const char *extension, const char
|
|||
}
|
||||
|
||||
pathLength = strlen( path );
|
||||
if ( path[pathLength-1] == '\\' || path[pathLength-1] == '/' ) {
|
||||
pathLength--;
|
||||
}
|
||||
extensionLength = strlen( extension );
|
||||
nfiles = 0;
|
||||
FS_ReturnPath(path, zpath, &pathDepth);
|
||||
|
@ -2451,7 +2454,11 @@ char **FS_ListFilteredFiles( const char *path, const char *extension, const char
|
|||
nfiles = FS_AddFileToList(zpath, list, nfiles);
|
||||
}
|
||||
else {
|
||||
nfiles = FS_AddFileToList(name + pathLength, list, nfiles);
|
||||
temp = pathLength;
|
||||
if (pathLength) {
|
||||
temp++; // include the '/'
|
||||
}
|
||||
nfiles = FS_AddFileToList(name + temp, list, nfiles);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3656,7 +3656,7 @@ static void ScanAndLoadShaderFiles( void )
|
|||
|
||||
long sum = 0;
|
||||
// scan for shader files
|
||||
shaderFiles = ri.FS_ListFiles("scripts/", ".shader", &numShaders);
|
||||
shaderFiles = ri.FS_ListFiles("scripts", ".shader", &numShaders);
|
||||
|
||||
if (!shaderFiles || !numShaders)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue