Skip to content

Commit

Permalink
use strstr to find sphaira within update zip, force restart upon upda…
Browse files Browse the repository at this point in the history
…te success.
  • Loading branch information
ITotalJustice committed Jan 12, 2025
1 parent c762daf commit 01e06a7
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions sphaira/source/ui/menus/main_menu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ auto InstallUpdate(ProgressBox* pbox, const std::string url, const std::string v
file_path = fs::AppendPath("/", file_path);
}

if (!strcasecmp(strrchr(file_path.s, '/'), "/sphaira.nro")) {
if (std::strstr(file_path, "sphaira.nro")) {
file_path = App::GetExePath();
}

Expand Down Expand Up @@ -279,11 +279,8 @@ MainMenu::MainMenu() {
m_update_state = UpdateState::None;
App::Notify("Updated to "_i18n + m_update_version);
App::Push(std::make_shared<OptionBox>(
"Restart Sphaira?"_i18n,
"Back"_i18n, "Restart"_i18n, 1, [this](auto op_index){
if (op_index && *op_index) {
App::ExitRestart();
}
"Press OK to restart Sphaira"_i18n, "OK"_i18n, [](auto){
App::ExitRestart();
}
));
} else {
Expand Down

0 comments on commit 01e06a7

Please sign in to comment.