Commit 50e01d78 authored by nekrozar's avatar nekrozar

fix

parent 24bc8c0c
...@@ -868,7 +868,7 @@ void Game::LoadExpansionDB() { ...@@ -868,7 +868,7 @@ void Game::LoadExpansionDB() {
HANDLE fh = FindFirstFileW(L"./expansions/*", &fdataw); HANDLE fh = FindFirstFileW(L"./expansions/*", &fdataw);
if(fh != INVALID_HANDLE_VALUE) { if(fh != INVALID_HANDLE_VALUE) {
do { do {
if((fdataw.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)) { if(wcscmp(L".",fdataw.cFileName) != 0 && wcscmp(L"..",fdataw.cFileName) != 0 && fdataw.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) {
char fname[780]; char fname[780];
BufferIO::EncodeUTF8(fdataw.cFileName, fname); BufferIO::EncodeUTF8(fdataw.cFileName, fname);
sprintf(fpath, "./expansions/%s", fname); sprintf(fpath, "./expansions/%s", fname);
...@@ -882,7 +882,7 @@ void Game::LoadExpansionDB() { ...@@ -882,7 +882,7 @@ void Game::LoadExpansionDB() {
struct dirent * dirp; struct dirent * dirp;
if((dir = opendir("./expansions/")) != NULL) { if((dir = opendir("./expansions/")) != NULL) {
while((dirp = readdir(dir)) != NULL) { while((dirp = readdir(dir)) != NULL) {
if (dirp->d_type != DT_DIR) if (strcmp(".", dirp->d_name) == 0 || strcmp("..", dirp->d_name) == 0 || dirp->d_type != DT_DIR)
continue; continue;
char filepath[1000]; char filepath[1000];
sprintf(filepath, "./expansions/%s/", dirp->d_name); sprintf(filepath, "./expansions/%s/", dirp->d_name);
...@@ -936,7 +936,7 @@ void Game::LoadExpansionStrings() { ...@@ -936,7 +936,7 @@ void Game::LoadExpansionStrings() {
HANDLE fh = FindFirstFileW(L"./expansions/*", &fdataw); HANDLE fh = FindFirstFileW(L"./expansions/*", &fdataw);
if(fh != INVALID_HANDLE_VALUE) { if(fh != INVALID_HANDLE_VALUE) {
do { do {
if((fdataw.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)) { if(wcscmp(L".",fdataw.cFileName) != 0 && wcscmp(L"..",fdataw.cFileName) != 0 && fdataw.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) {
char fname[780]; char fname[780];
BufferIO::EncodeUTF8(fdataw.cFileName, fname); BufferIO::EncodeUTF8(fdataw.cFileName, fname);
sprintf(fpath, "./expansions/%s", fname); sprintf(fpath, "./expansions/%s", fname);
...@@ -950,7 +950,7 @@ void Game::LoadExpansionStrings() { ...@@ -950,7 +950,7 @@ void Game::LoadExpansionStrings() {
struct dirent * dirp; struct dirent * dirp;
if((dir = opendir("./expansions/")) != NULL) { if((dir = opendir("./expansions/")) != NULL) {
while((dirp = readdir(dir)) != NULL) { while((dirp = readdir(dir)) != NULL) {
if (dirp->d_type != DT_DIR) if (strcmp(".", dirp->d_name) == 0 || strcmp("..", dirp->d_name) == 0 || dirp->d_type != DT_DIR)
continue; continue;
char filepath[1000]; char filepath[1000];
sprintf(filepath, "./expansions/%s/", dirp->d_name); sprintf(filepath, "./expansions/%s/", dirp->d_name);
......
...@@ -943,7 +943,7 @@ byte* ReplayMode::ScriptReaderEx(const char* script_name, int* slen) { ...@@ -943,7 +943,7 @@ byte* ReplayMode::ScriptReaderEx(const char* script_name, int* slen) {
HANDLE fh = FindFirstFileW(L"./expansions/*", &fdataw); HANDLE fh = FindFirstFileW(L"./expansions/*", &fdataw);
if(fh != INVALID_HANDLE_VALUE) { if(fh != INVALID_HANDLE_VALUE) {
do { do {
if((fdataw.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)) { if(wcscmp(L".",fdataw.cFileName) != 0 && wcscmp(L"..",fdataw.cFileName) != 0 && fdataw.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) {
char fname[780]; char fname[780];
BufferIO::EncodeUTF8(fdataw.cFileName, fname); BufferIO::EncodeUTF8(fdataw.cFileName, fname);
sprintf(fpath, "./expansions/%s", fname); sprintf(fpath, "./expansions/%s", fname);
...@@ -959,7 +959,7 @@ byte* ReplayMode::ScriptReaderEx(const char* script_name, int* slen) { ...@@ -959,7 +959,7 @@ byte* ReplayMode::ScriptReaderEx(const char* script_name, int* slen) {
struct dirent * dirp; struct dirent * dirp;
if((dir = opendir("./expansions/")) != NULL) { if((dir = opendir("./expansions/")) != NULL) {
while((dirp = readdir(dir)) != NULL) { while((dirp = readdir(dir)) != NULL) {
if (dirp->d_type != DT_DIR) if (strcmp(".", dirp->d_name) == 0 || strcmp("..", dirp->d_name) == 0 || dirp->d_type != DT_DIR)
continue; continue;
char filepath[1000]; char filepath[1000];
sprintf(filepath, "./expansions/%s/", dirp->d_name); sprintf(filepath, "./expansions/%s/", dirp->d_name);
......
...@@ -1553,7 +1553,7 @@ byte* SingleDuel::ScriptReaderEx(const char* script_name, int* slen) { ...@@ -1553,7 +1553,7 @@ byte* SingleDuel::ScriptReaderEx(const char* script_name, int* slen) {
HANDLE fh = FindFirstFileW(L"./expansions/*", &fdataw); HANDLE fh = FindFirstFileW(L"./expansions/*", &fdataw);
if(fh != INVALID_HANDLE_VALUE) { if(fh != INVALID_HANDLE_VALUE) {
do { do {
if((fdataw.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)) { if(wcscmp(L".",fdataw.cFileName) != 0 && wcscmp(L"..",fdataw.cFileName) != 0 && fdataw.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) {
char fname[780]; char fname[780];
BufferIO::EncodeUTF8(fdataw.cFileName, fname); BufferIO::EncodeUTF8(fdataw.cFileName, fname);
sprintf(fpath, "./expansions/%s", fname); sprintf(fpath, "./expansions/%s", fname);
...@@ -1569,7 +1569,7 @@ byte* SingleDuel::ScriptReaderEx(const char* script_name, int* slen) { ...@@ -1569,7 +1569,7 @@ byte* SingleDuel::ScriptReaderEx(const char* script_name, int* slen) {
struct dirent * dirp; struct dirent * dirp;
if((dir = opendir("./expansions/")) != NULL) { if((dir = opendir("./expansions/")) != NULL) {
while((dirp = readdir(dir)) != NULL) { while((dirp = readdir(dir)) != NULL) {
if (dirp->d_type != DT_DIR) if (strcmp(".", dirp->d_name) == 0 || strcmp("..", dirp->d_name) == 0 || dirp->d_type != DT_DIR)
continue; continue;
char filepath[1000]; char filepath[1000];
sprintf(filepath, "./expansions/%s/", dirp->d_name); sprintf(filepath, "./expansions/%s/", dirp->d_name);
......
...@@ -853,7 +853,7 @@ byte* SingleMode::ScriptReaderEx(const char* script_name, int* slen) { ...@@ -853,7 +853,7 @@ byte* SingleMode::ScriptReaderEx(const char* script_name, int* slen) {
HANDLE fh = FindFirstFileW(L"./expansions/*", &fdataw); HANDLE fh = FindFirstFileW(L"./expansions/*", &fdataw);
if(fh != INVALID_HANDLE_VALUE) { if(fh != INVALID_HANDLE_VALUE) {
do { do {
if((fdataw.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)) { if(wcscmp(L".",fdataw.cFileName) != 0 && wcscmp(L"..",fdataw.cFileName) != 0 && fdataw.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) {
char fname[780]; char fname[780];
BufferIO::EncodeUTF8(fdataw.cFileName, fname); BufferIO::EncodeUTF8(fdataw.cFileName, fname);
sprintf(fpath, "./expansions/%s", fname); sprintf(fpath, "./expansions/%s", fname);
...@@ -869,7 +869,7 @@ byte* SingleMode::ScriptReaderEx(const char* script_name, int* slen) { ...@@ -869,7 +869,7 @@ byte* SingleMode::ScriptReaderEx(const char* script_name, int* slen) {
struct dirent * dirp; struct dirent * dirp;
if((dir = opendir("./expansions/")) != NULL) { if((dir = opendir("./expansions/")) != NULL) {
while((dirp = readdir(dir)) != NULL) { while((dirp = readdir(dir)) != NULL) {
if (dirp->d_type != DT_DIR) if (strcmp(".", dirp->d_name) == 0 || strcmp("..", dirp->d_name) == 0 || dirp->d_type != DT_DIR)
continue; continue;
char filepath[1000]; char filepath[1000];
sprintf(filepath, "./expansions/%s/", dirp->d_name); sprintf(filepath, "./expansions/%s/", dirp->d_name);
......
...@@ -1671,7 +1671,7 @@ byte* TagDuel::ScriptReaderEx(const char* script_name, int* slen) { ...@@ -1671,7 +1671,7 @@ byte* TagDuel::ScriptReaderEx(const char* script_name, int* slen) {
HANDLE fh = FindFirstFileW(L"./expansions/*", &fdataw); HANDLE fh = FindFirstFileW(L"./expansions/*", &fdataw);
if(fh != INVALID_HANDLE_VALUE) { if(fh != INVALID_HANDLE_VALUE) {
do { do {
if((fdataw.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)) { if(wcscmp(L".",fdataw.cFileName) != 0 && wcscmp(L"..",fdataw.cFileName) != 0 && fdataw.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) {
char fname[780]; char fname[780];
BufferIO::EncodeUTF8(fdataw.cFileName, fname); BufferIO::EncodeUTF8(fdataw.cFileName, fname);
sprintf(fpath, "./expansions/%s", fname); sprintf(fpath, "./expansions/%s", fname);
...@@ -1687,7 +1687,7 @@ byte* TagDuel::ScriptReaderEx(const char* script_name, int* slen) { ...@@ -1687,7 +1687,7 @@ byte* TagDuel::ScriptReaderEx(const char* script_name, int* slen) {
struct dirent * dirp; struct dirent * dirp;
if((dir = opendir("./expansions/")) != NULL) { if((dir = opendir("./expansions/")) != NULL) {
while((dirp = readdir(dir)) != NULL) { while((dirp = readdir(dir)) != NULL) {
if (dirp->d_type != DT_DIR) if (strcmp(".", dirp->d_name) == 0 || strcmp("..", dirp->d_name) == 0 || dirp->d_type != DT_DIR)
continue; continue;
char filepath[1000]; char filepath[1000];
sprintf(filepath, "./expansions/%s/", dirp->d_name); sprintf(filepath, "./expansions/%s/", dirp->d_name);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment