Commit e4ff9cc9 by Alan Mishchenko

Added minor API to clean path on a Windows computer.

parent ad7c8d63
......@@ -103,6 +103,7 @@ extern char * Extra_FileNameExtension( char * FileName );
extern char * Extra_FileNameAppend( char * pBase, char * pSuffix );
extern char * Extra_FileNameGeneric( char * FileName );
extern char * Extra_FileNameGenericAppend( char * pBase, char * pSuffix );
extern void Extra_FileNameCorrectPath( char * FileName );
extern char * Extra_FileNameWithoutPath( char * FileName );
extern char * Extra_FilePathWithoutName( char * FileName );
extern int Extra_FileCheck( char * pFileName );
......
......@@ -205,6 +205,26 @@ char * Extra_FileNameGenericAppend( char * pBase, char * pSuffix )
SeeAlso []
***********************************************************************/
void Extra_FileNameCorrectPath( char * FileName )
{
char * pStart;
if ( FileName )
for ( pStart = FileName; *pStart; pStart++ )
if ( *pStart == '>' || *pStart == '\\' )
*pStart = '/';
}
/**Function*************************************************************
Synopsis []
Description []
SideEffects []
SeeAlso []
***********************************************************************/
char * Extra_FileNameWithoutPath( char * FileName )
{
char * pRes;
......@@ -220,8 +240,9 @@ char * Extra_FilePathWithoutName( char * FileName )
for ( pRes = FileName + strlen(FileName) - 1; pRes >= FileName; pRes-- )
if ( *pRes == '\\' || *pRes == '/' )
{
*pRes = 0;
return FileName;
*pRes = 0;
Extra_FileNameCorrectPath( FileName );
return FileName;
}
ABC_FREE( FileName );
return NULL;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment