summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrey Nazarov <skuller@skuller.net>2007-08-22 23:00:16 +0000
committerAndrey Nazarov <skuller@skuller.net>2007-08-22 23:00:16 +0000
commit10267d9ca8d73eac8e01f7a1ec1d0e27bfca4b5b (patch)
treed2a8ff72b3ac470c01da8dca49754061b04715a2
parent76751f7dfd09b713f75fc71fc0023257acc7b335 (diff)
Fixed Sys_ListFiles on Windows (demo menu now works).
-rw-r--r--source/sv_game.c2
-rw-r--r--source/sys_win.c11
2 files changed, 9 insertions, 4 deletions
diff --git a/source/sv_game.c b/source/sv_game.c
index 77020f5..350bcac 100644
--- a/source/sv_game.c
+++ b/source/sv_game.c
@@ -942,7 +942,7 @@ void SV_InitGameProgs ( void )
// get features
ggf = Sys_GetProcAddress( game_library, "GetGameFeatures" );
if( ggf ) {
-// gameFeatures = ggf( GAME_FEATURE_CLIENTNUM );
+ gameFeatures = ggf( GAME_FEATURE_CLIENTNUM );
}
// initialize
diff --git a/source/sys_win.c b/source/sys_win.c
index d5966d1..6327103 100644
--- a/source/sys_win.c
+++ b/source/sys_win.c
@@ -1016,13 +1016,14 @@ char **Sys_ListFiles( const char *rawPath, const char *extension, uint32 flags,
Com_ReplaceSeparators( findPath, '\\' );
Sys_ListFilteredFiles( listedFiles, &count, path, findPath, flags, length + 1 );
} else {
- if( extension ) {
+ if( !extension || strchr( extension, ';' ) ) {
+ Com_sprintf( findPath, sizeof( findPath ), "%s\\*", path );
+ } else {
if( *extension == '.' ) {
extension++;
}
Com_sprintf( findPath, sizeof( findPath ), "%s\\*.%s", path, extension );
- } else {
- Com_sprintf( findPath, sizeof( findPath ), "%s\\*", path );
+ extension = NULL; // do not check later
}
findHandle = FindFirstFileA( findPath, &findInfo );
@@ -1045,6 +1046,10 @@ char **Sys_ListFiles( const char *rawPath, const char *extension, uint32 flags,
}
}
+ if( extension && !FS_ExtCmp( extension, findInfo.cFileName ) ) {
+ continue;
+ }
+
name = ( flags & FS_SEARCH_SAVEPATH ) ? va( "%s\\%s", path, findInfo.cFileName ) : findInfo.cFileName;
if( flags & FS_SEARCH_EXTRAINFO ) {