Skip to content

Commit

Permalink
public: make COM_FixSlashes inlined
Browse files Browse the repository at this point in the history
  • Loading branch information
a1batross committed Dec 29, 2024
1 parent 62f3354 commit 03eac90
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 16 deletions.
15 changes: 0 additions & 15 deletions public/crtlib.c
Original file line number Diff line number Diff line change
Expand Up @@ -663,21 +663,6 @@ void COM_RemoveLineFeed( char *str, size_t bufsize )
}
}

/*
============
COM_FixSlashes
Changes all '\' characters into '/' characters, in place.
============
*/
void COM_FixSlashes( char *pname )
{
while(( pname = Q_strchr( pname, '\\' )))
{
*pname = '/';
}
}

/*
============
COM_PathSlashFix
Expand Down
14 changes: 13 additions & 1 deletion public/crtlib.h
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,6 @@ void COM_ExtractFilePath( const char *path, char *dest );
const char *COM_FileWithoutPath( const char *in );
void COM_StripExtension( char *path );
void COM_RemoveLineFeed( char *str, size_t bufsize );
void COM_FixSlashes( char *pname );
void COM_PathSlashFix( char *path );
// return 0 on empty or null string, 1 otherwise
#define COM_CheckString( string ) ( ( !string || !*string ) ? 0 : 1 )
Expand Down Expand Up @@ -320,6 +319,19 @@ static inline int Q_splitstr( char *str, int delim, void *userdata,
return ret;
}

/*
============
COM_FixSlashes
Changes all '\' characters into '/' characters, in place.
============
*/
static inline void COM_FixSlashes( char *pname )
{
while(( pname = Q_strchr( pname, '\\' )))
*pname = '/';
}

#ifdef __cplusplus
}
#endif
Expand Down

0 comments on commit 03eac90

Please sign in to comment.