mirror of
https://github.com/YGGverse/xash3d-fwgs.git
synced 2025-01-30 08:44:31 +00:00
filesystem: dir: fix FS_FixFileCase when empty string is passed. Always append slash to searchpath.
This commit is contained in:
parent
37e890f326
commit
a6ecc778fc
@ -290,6 +290,10 @@ qboolean FS_FixFileCase( dir_t *dir, const char *path, char *dst, const size_t l
|
|||||||
if( !FS_AppendToPath( dst, &i, len, dir->name, path, "init" ))
|
if( !FS_AppendToPath( dst, &i, len, dir->name, path, "init" ))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
// nothing to fix
|
||||||
|
if( !COM_CheckStringEmpty( path ))
|
||||||
|
return true;
|
||||||
|
|
||||||
for( prev = path, next = Q_strchrnul( prev, '/' );
|
for( prev = path, next = Q_strchrnul( prev, '/' );
|
||||||
;
|
;
|
||||||
prev = next + 1, next = Q_strchrnul( prev, '/' ))
|
prev = next + 1, next = Q_strchrnul( prev, '/' ))
|
||||||
@ -464,8 +468,12 @@ void FS_InitDirectorySearchpath( searchpath_t *search, const char *path, int fla
|
|||||||
{
|
{
|
||||||
memset( search, 0, sizeof( searchpath_t ));
|
memset( search, 0, sizeof( searchpath_t ));
|
||||||
|
|
||||||
Q_strncpy( search->filename, path, sizeof( search->filename ));
|
Q_strncpy( search->filename, path, sizeof( search->filename ) - 1 );
|
||||||
search->type = SEARCHPATH_PLAIN;
|
COM_PathSlashFix( search->filename );
|
||||||
|
|
||||||
|
if( !Q_stricmp( COM_FileExtension( path ), "pk3dir" ))
|
||||||
|
search->type = SEARCHPATH_PK3DIR;
|
||||||
|
else search->type = SEARCHPATH_PLAIN;
|
||||||
search->flags = flags;
|
search->flags = flags;
|
||||||
search->pfnPrintInfo = FS_PrintInfo_DIR;
|
search->pfnPrintInfo = FS_PrintInfo_DIR;
|
||||||
search->pfnClose = FS_Close_DIR;
|
search->pfnClose = FS_Close_DIR;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user