This is an automated email from the git hooks/post-receive script.

smcv pushed a commit to annotated tag 1.42d
in repository iortcw.

commit 01a49b8d5926f54f3ebc4d9fc7080ebf919e22c8
Author: Donny <m4n4t4...@gmail.com>
Date:   Wed Jul 8 12:22:49 2015 -0400

    All: Fix Windows file list extension check
---
 MP/code/sys/sys_win32.c | 11 +++++++++++
 SP/code/sys/sys_win32.c | 11 +++++++++++
 2 files changed, 22 insertions(+)

diff --git a/MP/code/sys/sys_win32.c b/MP/code/sys/sys_win32.c
index e243754..84dce76 100644
--- a/MP/code/sys/sys_win32.c
+++ b/MP/code/sys/sys_win32.c
@@ -470,6 +470,7 @@ char **Sys_ListFiles( const char *directory, const char 
*extension, char *filter
        intptr_t                findhandle;
        int                     flag;
        int                     i;
+       int                     extLen;
 
        if (filter) {
 
@@ -503,6 +504,8 @@ char **Sys_ListFiles( const char *directory, const char 
*extension, char *filter
                flag = _A_SUBDIR;
        }
 
+       extLen = strlen( extension );
+
        Com_sprintf( search, sizeof(search), "%s\\*%s", directory, extension );
 
        // search
@@ -516,6 +519,14 @@ char **Sys_ListFiles( const char *directory, const char 
*extension, char *filter
 
        do {
                if ( (!wantsubs && flag ^ ( findinfo.attrib & _A_SUBDIR )) || 
(wantsubs && findinfo.attrib & _A_SUBDIR) ) {
+                       if (*extension) {
+                               if ( strlen( findinfo.name ) < extLen ||
+                                       Q_stricmp(
+                                               findinfo.name + strlen( 
findinfo.name ) - extLen,
+                                               extension ) ) {
+                                       continue; // didn't match
+                               }
+                       }
                        if ( nfiles == MAX_FOUND_FILES - 1 ) {
                                break;
                        }
diff --git a/SP/code/sys/sys_win32.c b/SP/code/sys/sys_win32.c
index d466de4..8f67cc7 100644
--- a/SP/code/sys/sys_win32.c
+++ b/SP/code/sys/sys_win32.c
@@ -411,6 +411,7 @@ char **Sys_ListFiles( const char *directory, const char 
*extension, char *filter
        intptr_t                findhandle;
        int                     flag;
        int                     i;
+       int                     extLen;
 
        if (filter) {
 
@@ -444,6 +445,8 @@ char **Sys_ListFiles( const char *directory, const char 
*extension, char *filter
                flag = _A_SUBDIR;
        }
 
+       extLen = strlen( extension );
+
        Com_sprintf( search, sizeof(search), "%s\\*%s", directory, extension );
 
        // search
@@ -457,6 +460,14 @@ char **Sys_ListFiles( const char *directory, const char 
*extension, char *filter
 
        do {
                if ( (!wantsubs && flag ^ ( findinfo.attrib & _A_SUBDIR )) || 
(wantsubs && findinfo.attrib & _A_SUBDIR) ) {
+                       if (*extension) {
+                               if ( strlen( findinfo.name ) < extLen ||
+                                       Q_stricmp(
+                                               findinfo.name + strlen( 
findinfo.name ) - extLen,
+                                               extension ) ) {
+                                       continue; // didn't match
+                               }
+                       }
                        if ( nfiles == MAX_FOUND_FILES - 1 ) {
                                break;
                        }

-- 
Alioth's /usr/local/bin/git-commit-notice on 
/srv/git.debian.org/git/pkg-games/iortcw.git

_______________________________________________
Pkg-games-commits mailing list
Pkg-games-commits@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-games-commits

Reply via email to