Windows fixes.
This commit is contained in:
parent
d0c4f1da8b
commit
4d325c447e
2 changed files with 16 additions and 1 deletions
15
src/main.c
15
src/main.c
|
@ -29,6 +29,7 @@
|
|||
#include <stdio.h>
|
||||
#include <stdarg.h>
|
||||
#include <dirent.h>
|
||||
#include <sys/stat.h>
|
||||
|
||||
#include "include/archive.h"
|
||||
#include "include/archive_entry.h"
|
||||
|
@ -875,6 +876,8 @@ void unpackGames(void) {
|
|||
char *types[] = { "Game", "Tool", "Patch", 0 };
|
||||
char *badFilenames[] = { "controls.dat", "Framework.singe", 0 };
|
||||
char *badExtensions[] = { "exe", "sh", "bat", "cmd", "index", 0 };
|
||||
struct stat fileStat;
|
||||
bool isFile;
|
||||
|
||||
// Games cannot include forbidden extensions, Singe binaries, multiple folders, etc.
|
||||
// Tools are like games but do not need a games.dat file.
|
||||
|
@ -883,7 +886,17 @@ void unpackGames(void) {
|
|||
if (dir == NULL) utilDie("Could not open the current directory.");
|
||||
|
||||
while ((de = readdir(dir)) != NULL) {
|
||||
if (de->d_type == DT_REG || de->d_type == DT_LNK || de->d_type == DT_UNKNOWN) {
|
||||
|
||||
isFile = false;
|
||||
if ((strcmp(de->d_name, ".") != 0) && (strcmp(de->d_name, "..") != 0)) {
|
||||
if (stat(de->d_name, &fileStat) == 0) {
|
||||
if (S_ISREG(fileStat.st_mode) || S_ISLNK(fileStat.st_mode)) {
|
||||
isFile = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (isFile) {
|
||||
packageType = -1;
|
||||
x = 0;
|
||||
while (types[x] != NULL) {
|
||||
|
|
2
thirdparty/luasec/src/compat.h
vendored
2
thirdparty/luasec/src/compat.h
vendored
|
@ -62,7 +62,9 @@
|
|||
|
||||
// Added by Scott Duensing to work with existing luasocket for Singe.
|
||||
#ifndef SOCKET_SELECT
|
||||
#ifndef _WIN32
|
||||
#include <sys/poll.h>
|
||||
#endif
|
||||
#define WAITFD_R POLLIN
|
||||
#define WAITFD_W POLLOUT
|
||||
#define WAITFD_C (POLLIN|POLLOUT)
|
||||
|
|
Loading…
Add table
Reference in a new issue