diff options
Diffstat (limited to 'main')
-rw-r--r-- | main/main.cpp | 4 | ||||
-rw-r--r-- | main/tests/test_string.cpp | 5 |
2 files changed, 6 insertions, 3 deletions
diff --git a/main/main.cpp b/main/main.cpp index 96b71c1663..608b4a7c4d 100644 --- a/main/main.cpp +++ b/main/main.cpp @@ -780,7 +780,7 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph } else if (I->get().ends_with("project.godot")) { String path; String file = I->get(); - int sep = MAX(file.find_last("/"), file.find_last("\\")); + int sep = MAX(file.rfind("/"), file.rfind("\\")); if (sep == -1) { path = "."; } else { @@ -1992,7 +1992,7 @@ bool Main::start() { local_game_path = "res://" + local_game_path; } else { - int sep = local_game_path.find_last("/"); + int sep = local_game_path.rfind("/"); if (sep == -1) { DirAccess *da = DirAccess::create(DirAccess::ACCESS_FILESYSTEM); diff --git a/main/tests/test_string.cpp b/main/tests/test_string.cpp index 5a14492be5..73d59b0088 100644 --- a/main/tests/test_string.cpp +++ b/main/tests/test_string.cpp @@ -370,8 +370,11 @@ bool test_22() { static const int num[4] = { 1237461283, -22, 0, -1123412 }; for (int i = 0; i < 4; i++) { +#ifdef __MINGW32__ // MinGW can't handle normal format specifiers for some reason. So we need special code just for MinGW. + OS::get_singleton()->print("\tString: \"%s\" as Int is %I64i\n", nums[i], (long long)(String(nums[i]).to_int())); +#else OS::get_singleton()->print("\tString: \"%s\" as Int is %lli\n", nums[i], (long long)(String(nums[i]).to_int())); - +#endif if (String(nums[i]).to_int() != num[i]) { return false; } |