mirror of
https://github.com/YGGverse/xash3d-fwgs.git
synced 2025-01-26 06:45:08 +00:00
utils: mdldec: always write trailing slash for non-empty destination path.
This commit is contained in:
parent
b6a235445a
commit
8d7b9c2f01
@ -43,7 +43,7 @@ static qboolean IsValidName( char *name )
|
|||||||
if( !( isalpha( *name ) || isdigit( *name )))
|
if( !( isalpha( *name ) || isdigit( *name )))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
while( *( ++name))
|
while( *( ++name ))
|
||||||
{
|
{
|
||||||
if( isalpha( *name ) || isdigit( *name )
|
if( isalpha( *name ) || isdigit( *name )
|
||||||
|| *name == '.' || *name == '-' || *name == '_'
|
|| *name == '.' || *name == '-' || *name == '_'
|
||||||
@ -305,7 +305,7 @@ static qboolean LoadMDL( const char *modelname )
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if( Q_strcmp( ext, "mdl" ) )
|
if( Q_stricmp( ext, "mdl" ) )
|
||||||
{
|
{
|
||||||
fprintf( stderr, "ERROR: Only .mdl-files is supported.\n" );
|
fprintf( stderr, "ERROR: Only .mdl-files is supported.\n" );
|
||||||
return false;
|
return false;
|
||||||
@ -349,17 +349,18 @@ static qboolean LoadMDL( const char *modelname )
|
|||||||
|
|
||||||
if( destdir[0] != '\0' )
|
if( destdir[0] != '\0' )
|
||||||
{
|
{
|
||||||
if( !MakeDirectory( destdir ) )
|
if( !MakeDirectory( destdir ))
|
||||||
{
|
{
|
||||||
fprintf( stderr, "ERROR: Couldn't create directory %s\n", destdir );
|
fprintf( stderr, "ERROR: Couldn't create directory %s\n", destdir );
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
COM_PathSlashFix( destdir );
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
COM_ExtractFilePath( modelname, destdir );
|
COM_ExtractFilePath( modelname, destdir );
|
||||||
|
|
||||||
|
if( destdir[0] != '\0' )
|
||||||
|
COM_PathSlashFix( destdir );
|
||||||
|
|
||||||
len -= ( sizeof( ".mdl" ) - 1 ); // path length without extension
|
len -= ( sizeof( ".mdl" ) - 1 ); // path length without extension
|
||||||
|
|
||||||
if( !model_hdr->numtextures )
|
if( !model_hdr->numtextures )
|
||||||
|
Loading…
x
Reference in New Issue
Block a user