Skip to content

Commit

Permalink
utils: mdldec: always write trailing slash for non-empty destination …
Browse files Browse the repository at this point in the history
…path.
  • Loading branch information
nekonomicon authored and a1batross committed Nov 22, 2023
1 parent b6a2354 commit 8d7b9c2
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions utils/mdldec/mdldec.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ static qboolean IsValidName( char *name )
if( !( isalpha( *name ) || isdigit( *name )))
return false;

while( *( ++name))
while( *( ++name ))
{
if( isalpha( *name ) || isdigit( *name )
|| *name == '.' || *name == '-' || *name == '_'
Expand Down Expand Up @@ -305,7 +305,7 @@ static qboolean LoadMDL( const char *modelname )
return false;
}

if( Q_strcmp( ext, "mdl" ) )
if( Q_stricmp( ext, "mdl" ) )
{
fprintf( stderr, "ERROR: Only .mdl-files is supported.\n" );
return false;
Expand Down Expand Up @@ -349,17 +349,18 @@ static qboolean LoadMDL( const char *modelname )

if( destdir[0] != '\0' )
{
if( !MakeDirectory( destdir ) )
if( !MakeDirectory( destdir ))
{
fprintf( stderr, "ERROR: Couldn't create directory %s\n", destdir );
return false;
}

COM_PathSlashFix( destdir );
}
else
COM_ExtractFilePath( modelname, destdir );

if( destdir[0] != '\0' )
COM_PathSlashFix( destdir );

len -= ( sizeof( ".mdl" ) - 1 ); // path length without extension

if( !model_hdr->numtextures )
Expand Down

0 comments on commit 8d7b9c2

Please sign in to comment.