diff options
Diffstat (limited to 'code/qcommon')
-rw-r--r-- | code/qcommon/files.c | 1 | ||||
-rw-r--r-- | code/qcommon/q_shared.c | 22 | ||||
-rw-r--r-- | code/qcommon/q_shared.h | 1 |
3 files changed, 23 insertions, 1 deletions
diff --git a/code/qcommon/files.c b/code/qcommon/files.c index 8a056d5..4a909e3 100644 --- a/code/qcommon/files.c +++ b/code/qcommon/files.c @@ -1207,7 +1207,6 @@ int FS_FOpenFileRead( const char *filename, fileHandle_t *file, qboolean uniqueF } } - Com_DPrintf ("Can't find %s\n", filename); #ifdef FS_MISSING if (missingFiles) { fprintf(missingFiles, "%s\n", filename); diff --git a/code/qcommon/q_shared.c b/code/qcommon/q_shared.c index b30688a..a68b283 100644 --- a/code/qcommon/q_shared.c +++ b/code/qcommon/q_shared.c @@ -55,6 +55,28 @@ char *COM_SkipPath (char *pathname) /* ============ +COM_GetExtension +============ +*/ +const char *COM_GetExtension( const char *name ) { + int length, i; + + length = strlen(name)-1; + i = length; + + while (name[i] != '.') + { + i--; + if (name[i] == '/' || i == 0) + return ""; // no extension + } + + return &name[i+1]; +} + + +/* +============ COM_StripExtension ============ */ diff --git a/code/qcommon/q_shared.h b/code/qcommon/q_shared.h index e3a062a..fcd48e0 100644 --- a/code/qcommon/q_shared.h +++ b/code/qcommon/q_shared.h @@ -599,6 +599,7 @@ int Q_isnan( float x ); float Com_Clamp( float min, float max, float value ); char *COM_SkipPath( char *pathname ); +const char *COM_GetExtension( const char *name ); void COM_StripExtension(const char *in, char *out, int destsize); void COM_DefaultExtension( char *path, int maxSize, const char *extension ); |