diff options
author | Andrey Nazarov <skuller@skuller.net> | 2008-03-05 20:14:36 +0000 |
---|---|---|
committer | Andrey Nazarov <skuller@skuller.net> | 2008-03-05 20:14:36 +0000 |
commit | bf0e48bb73e2d6846e15335e3625290d1f9ebc52 (patch) | |
tree | e2804860de7d1b59c263ec04f81044b35a7369f2 /source/cl_parse.c | |
parent | 856cdd0f2fafeaa31c7398c8877180c68364842d (diff) |
Rewrote autocompletion engine.
Added `con_notifylines' variable.
Do not allow chat beeps to overlap.
Diffstat (limited to 'source/cl_parse.c')
-rw-r--r-- | source/cl_parse.c | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/source/cl_parse.c b/source/cl_parse.c index cea58e4..1f904c1 100644 --- a/source/cl_parse.c +++ b/source/cl_parse.c @@ -24,10 +24,10 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. //============================================================================= -static const char *const validExts[] = { - ".pcx", ".wal", ".tga", ".jpg", ".png", - ".md2", ".md3", ".sp2", ".wav", ".dm2", - ".bsp", ".txt", ".loc", ".ent", NULL +static const char validExts[][4] = { + "pcx", "wal", "tga", "jpg", "png", + "md2", "md3", "sp2", "wav", "dm2", + "bsp", "txt", "loc", "ent", "" }; /* @@ -63,12 +63,16 @@ qboolean CL_CheckOrDownloadFile( const char *path ) { // a trivial attempt to prevent malicious server from // uploading trojan executables to the win32 client ext = COM_FileExtension( filename ); - for( i = 0; validExts[i]; i++ ) { - if( !strcmp( ext, validExts[i] ) ) { + if( *ext != '.' ) { + Com_WPrintf( "Refusing to download file without extension.\n" ); + return qtrue; + } + for( i = 0; validExts[i][0]; i++ ) { + if( !strcmp( ext + 1, validExts[i] ) ) { break; } } - if( !validExts[i] ) { + if( !validExts[i][0] ) { Com_WPrintf( "Refusing to download file with invalid extension.\n" ); return qtrue; } @@ -1297,7 +1301,7 @@ static void CL_ParsePrint( void ) { // play sound if( cl_chat_sound->string[0] ) { - S_StartLocalSound( cl_chat_sound->string ); + S_StartLocalSound_( cl_chat_sound->string ); } } |