diff --git a/src/main.c b/src/main.c index dbc739634..d558f84f5 100644 --- a/src/main.c +++ b/src/main.c @@ -890,7 +890,11 @@ void unpackGames(void) { isFile = false; if ((strcmp(de->d_name, ".") != 0) && (strcmp(de->d_name, "..") != 0)) { if (stat(de->d_name, &fileStat) == 0) { +#ifdef _WIN32 + if (S_ISREG(fileStat.st_mode)) { +#else if (S_ISREG(fileStat.st_mode) || S_ISLNK(fileStat.st_mode)) { +#endif isFile = true; } } diff --git a/thirdparty/luasec/src/context.c b/thirdparty/luasec/src/context.c index 881ebb905..3189b620c 100644 --- a/thirdparty/luasec/src/context.c +++ b/thirdparty/luasec/src/context.c @@ -9,6 +9,7 @@ #include #if defined(WIN32) +#include #include #endif @@ -120,7 +121,7 @@ static const SSL_METHOD* str2method(const char *method, int *vmin, int *vmax) */ static int set_verify_flag(const char *str, int *flag) { - if (!strcmp(str, "none")) { + if (!strcmp(str, "none")) { *flag |= SSL_VERIFY_NONE; return 1; } @@ -132,7 +133,7 @@ static int set_verify_flag(const char *str, int *flag) *flag |= SSL_VERIFY_CLIENT_ONCE; return 1; } - if (!strcmp(str, "fail_if_no_peer_cert")) { + if (!strcmp(str, "fail_if_no_peer_cert")) { *flag |= SSL_VERIFY_FAIL_IF_NO_PEER_CERT; return 1; } @@ -399,7 +400,7 @@ static int load_key(lua_State *L) SSL_CTX_set_default_passwd_cb(ctx, passwd_cb); SSL_CTX_set_default_passwd_cb_userdata(ctx, L); /* fallback */ - case LUA_TNIL: + case LUA_TNIL: if (SSL_CTX_use_PrivateKey_file(ctx, filename, SSL_FILETYPE_PEM) == 1) lua_pushboolean(L, 1); else { @@ -543,7 +544,7 @@ static int set_mode(lua_State *L) lua_pushboolean(L, 0); lua_pushfstring(L, "invalid mode (%s)", str); return 1; -} +} /** * Configure DH parameters. @@ -677,7 +678,7 @@ static int alpn_cb(SSL *s, const unsigned char **out, unsigned char *outlen, if (ret != OPENSSL_NPN_NEGOTIATED) { lua_pop(L, 2); return SSL_TLSEXT_ERR_NOACK; - } + } // Copy the result because lua_pop() can collect the pointer ctx->alpn = malloc(*outlen);