From f96d478fcb09aea4722e39f801ec9f3cd47fde8e Mon Sep 17 00:00:00 2001 From: "fix94.1" Date: Fri, 22 Feb 2013 21:18:34 +0000 Subject: [PATCH] -fixed languages not selectable when wiiflow folder is on ntfs (issue 171) -better way to get wii game installation back to work --- source/loader/wbfs.c | 1 - source/loader/wbfs_ext.c | 6 ++---- source/menu/menu.cpp | 4 ++-- source/menu/menu_about.cpp | 2 +- source/menu/menu_config_adv.cpp | 6 +++--- 5 files changed, 8 insertions(+), 11 deletions(-) diff --git a/source/loader/wbfs.c b/source/loader/wbfs.c index b2d5c2c5..971d9d3d 100644 --- a/source/loader/wbfs.c +++ b/source/loader/wbfs.c @@ -215,7 +215,6 @@ s32 WBFS_Init(wbfs_t * handle, u32 part_fs, u32 part_idx, u32 part_lba, const ch hdd = handle; wbfsDev = strncasecmp(partition, "sd", 2) == 0 ? WBFS_DEVICE_SDHC : WBFS_DEVICE_USB; strcpy(wbfs_fs_drive, partition); - strcat(wbfs_fs_drive, ":"); wbfs_part_fs = part_fs; wbfs_part_lba = part_lba; diff --git a/source/loader/wbfs_ext.c b/source/loader/wbfs_ext.c index 9a747959..3697925f 100644 --- a/source/loader/wbfs_ext.c +++ b/source/loader/wbfs_ext.c @@ -29,7 +29,6 @@ #define TITLE_LEN 64 -char wbfs_drive_tmp[16]; char wbfs_fs_drive[16]; char invalid_path[] = "/\\:|<>?*\"'"; @@ -102,7 +101,7 @@ s32 WBFS_Ext_DiskSpace(f32 *used, f32 *free) // statvfs is slow, so cache values if (!wbfs_ext_vfs_have || wbfs_ext_vfs_lba != (s32)wbfs_part_lba || wbfs_ext_vfs_dev != wbfsDev ) { - if(statvfs(wbfs_fs_drive, &wbfs_ext_vfs)) + if(statvfs(fmt("%s:", wbfs_fs_drive), &wbfs_ext_vfs)) return 0; wbfs_ext_vfs_have = 1; @@ -187,8 +186,7 @@ s32 WBFS_Ext_AddGame(progress_callback_t spinner, void *spinner_data) asprintf(&cleantitle, header.title); for(cp = strpbrk(cleantitle, illegal); cp; cp = strpbrk(cp, illegal)) *cp = '_'; - strncpy(wbfs_drive_tmp, wbfs_fs_drive, strlen(wbfs_fs_drive) - 1); - strncpy(folder, fmt(wii_games_dir, wbfs_drive_tmp), sizeof(folder)); + strncpy(folder, fmt(wii_games_dir, wbfs_fs_drive), sizeof(folder)); fsop_MakeFolder(folder); strncpy(folder, fmt("%s/%s [%s]", folder, cleantitle, header.id), sizeof(folder)); fsop_MakeFolder(folder); diff --git a/source/menu/menu.cpp b/source/menu/menu.cpp index 197169d0..c9c47d01 100644 --- a/source/menu/menu.cpp +++ b/source/menu/menu.cpp @@ -419,11 +419,11 @@ void CMenu::init() defaultMenuLanguage = 2; //Brazilian m_curLanguage = CMenu::_translations[m_cfg.getInt("GENERAL", "language", defaultMenuLanguage)]; - if (!m_loc.load(fmt("%s/%s.ini", m_languagesDir.c_str(), m_curLanguage.c_str()))) + if (!m_loc.load(fmt("%s/%s.ini", m_languagesDir.c_str(), lowerCase(m_curLanguage).c_str()))) { m_cfg.setInt("GENERAL", "language", 0); m_curLanguage = CMenu::_translations[0]; - m_loc.load(fmt("%s/%s.ini", m_languagesDir.c_str(), m_curLanguage.c_str())); + m_loc.load(fmt("%s/%s.ini", m_languagesDir.c_str(), lowerCase(m_curLanguage).c_str())); } m_tempView = false; diff --git a/source/menu/menu_about.cpp b/source/menu/menu_about.cpp index 75f0d162..e42c030a 100644 --- a/source/menu/menu_about.cpp +++ b/source/menu/menu_about.cpp @@ -111,7 +111,7 @@ void CMenu::_textAbout(void) { m_btnMgr.setText(m_aboutLblTitle, _t("about10", L"Help Guide")); wstringEx help_text; - FILE *f = fopen(fmt("%s/%s.txt", m_helpDir.c_str(), m_curLanguage.c_str()), "r"); + FILE *f = fopen(fmt("%s/%s.txt", m_helpDir.c_str(), lowerCase(m_curLanguage).c_str()), "r"); if(f) { fseek(f, 0, SEEK_END); diff --git a/source/menu/menu_config_adv.cpp b/source/menu/menu_config_adv.cpp index 66be191d..f4379442 100644 --- a/source/menu/menu_config_adv.cpp +++ b/source/menu/menu_config_adv.cpp @@ -136,7 +136,7 @@ int CMenu::_configAdv(void) s8 direction = m_btnMgr.selected(m_configAdvBtnCurLanguageP) ? 1 : -1; int lang = (int)loopNum((u32)m_cfg.getInt("GENERAL", "language", 0) + direction, ARRAY_SIZE(CMenu::_translations)); m_curLanguage = CMenu::_translations[lang]; - if (m_loc.load(fmt("%s/%s.ini", m_languagesDir.c_str(), m_curLanguage.c_str()))) + if (m_loc.load(fmt("%s/%s.ini", m_languagesDir.c_str(), lowerCase(m_curLanguage).c_str()))) { m_cfg.setInt("GENERAL", "language", lang); lang_changed = true; @@ -148,13 +148,13 @@ int CMenu::_configAdv(void) lang = (int)loopNum((u32)lang + direction, ARRAY_SIZE(CMenu::_translations)); m_curLanguage = CMenu::_translations[lang]; struct stat langs; - if (stat(fmt("%s/%s.ini", m_languagesDir.c_str(), m_curLanguage.c_str()), &langs) == 0) + if (stat(fmt("%s/%s.ini", m_languagesDir.c_str(), lowerCase(m_curLanguage).c_str()), &langs) == 0) break; } m_cfg.setInt("GENERAL", "language", lang); lang_changed = true; m_curLanguage = CMenu::_translations[lang]; - m_loc.load(fmt("%s/%s.ini", m_languagesDir.c_str(), m_curLanguage.c_str())); + m_loc.load(fmt("%s/%s.ini", m_languagesDir.c_str(), lowerCase(m_curLanguage).c_str())); } _updateText(); _showConfigAdv();