2
0
mirror of https://github.com/FWGS/xash3d-fwgs synced 2024-11-22 01:45:19 +01:00

public: disallow backslashes in COM_PathSlashFix

This commit is contained in:
Alibek Omarov 2024-07-30 14:22:08 +03:00
parent 107d4cdd61
commit 2f26fcdc2a

View File

@ -686,15 +686,19 @@ void COM_FixSlashes( char *pname )
/*
============
COM_PathSlashFix
ensure directory path always ends on forward slash
============
*/
void COM_PathSlashFix( char *path )
{
size_t len;
size_t len = Q_strlen( path );
len = Q_strlen( path );
if( path[len - 1] != '\\' && path[len - 1] != '/' )
if( path[len - 1] == '\\' )
{
path[len - 1] = '/';
}
else if( path[len - 1] != '/' )
{
path[len] = '/';
path[len + 1] = '\0';