Commit 069a6daa authored by nanahira's avatar nanahira

catchup

parent 18adae0a
......@@ -50,14 +50,14 @@ void DeckManager::LoadLFListSingle(const char* path) {
}
}
void DeckManager::LoadLFList() {
//LoadLFListSingle("expansions/lflist.conf");
LoadLFListSingle("expansions/lflist.conf");
#ifdef _WIN32
char fpath[1000];
WIN32_FIND_DATAW fdataw;
HANDLE fh = FindFirstFileW(L"./expansions/*", &fdataw);
if(fh != INVALID_HANDLE_VALUE) {
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];
BufferIO::EncodeUTF8(fdataw.cFileName, fname);
sprintf(fpath, "./expansions/%s/lflist.conf", fname);
......@@ -71,7 +71,7 @@ void DeckManager::LoadLFList() {
struct dirent * dirp;
if((dir = opendir("./expansions/")) != 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;
char filepath[1000];
sprintf(filepath, "./expansions/%s/lflist.conf", dirp->d_name);
......
......@@ -335,7 +335,7 @@ irr::video::ITexture* ImageManager::GetTextureExpansions(char* file, s32 width,
HANDLE fh = FindFirstFileW(L"./expansions/*", &fdataw);
if(fh != INVALID_HANDLE_VALUE) {
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];
BufferIO::EncodeUTF8(fdataw.cFileName, fname);
sprintf(fpath, "./expansions/%s", fname);
......@@ -351,7 +351,7 @@ irr::video::ITexture* ImageManager::GetTextureExpansions(char* file, s32 width,
struct dirent * dirp;
if((dir = opendir("./expansions/")) != 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;
char filepath[1000];
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