]> git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - filematch.c
avoid NULL pointer access if a surface had an unsupported type
[xonotic/darkplaces.git] / filematch.c
index 4bacbc15a1704029ff223c09b98a8c369bff8bf1..9ff8a767514a39667afb4f3c867a15b014ad7d8e 100644 (file)
@@ -1,10 +1,4 @@
 
-#ifdef WIN32
-#include <windows.h>
-#else
-#include <dirent.h>
-#endif
-
 #include "quakedef.h"
 
 // LordHavoc: some portable directory listing code I wrote for lmp2pcx, now used in darkplaces to load id1/*.pak and such...
@@ -147,6 +141,7 @@ static void adddirentry(stringlist_t *list, const char *path, const char *name)
        }
 }
 #ifdef WIN32
+#include <windows.h>
 void listdirectory(stringlist_t *list, const char *basepath, const char *path)
 {
        int i;
@@ -172,6 +167,7 @@ void listdirectory(stringlist_t *list, const char *basepath, const char *path)
                                *c += 'a' - 'A';
 }
 #else
+#include <dirent.h>
 void listdirectory(stringlist_t *list, const char *basepath, const char *path)
 {
        char fullpath[MAX_OSPATH];