mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-15 23:20:36 +01:00
Core/Updater: Fix detection of the mysql binary when a directory is given as path
This ensures that we never pass a directory path StartProcess which results in a crash.
Closes #25216
(cherry picked from commit 98b1b20d6b)
This commit is contained in:
@@ -40,10 +40,10 @@ std::string DBUpdaterUtil::GetCorrectedMySQLExecutable()
|
||||
bool DBUpdaterUtil::CheckExecutable()
|
||||
{
|
||||
boost::filesystem::path exe(GetCorrectedMySQLExecutable());
|
||||
if (!exists(exe))
|
||||
if (!is_regular_file(exe))
|
||||
{
|
||||
exe = Trinity::SearchExecutableInPath("mysql");
|
||||
if (!exe.empty() && exists(exe))
|
||||
if (!exe.empty() && is_regular_file(exe))
|
||||
{
|
||||
// Correct the path to the cli
|
||||
corrected_path() = absolute(exe).generic_string();
|
||||
|
||||
Reference in New Issue
Block a user