diff options
-rw-r--r-- | logic/minecraft/MinecraftInstance.cpp | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/logic/minecraft/MinecraftInstance.cpp b/logic/minecraft/MinecraftInstance.cpp index 0dab4dfe..05dedf1d 100644 --- a/logic/minecraft/MinecraftInstance.cpp +++ b/logic/minecraft/MinecraftInstance.cpp @@ -132,6 +132,24 @@ QMap<QString, QString> MinecraftInstance::getVariables() const return out; } +static QString processLD_LIBRARY_PATH(const QString & LD_LIBRARY_PATH) +{ + QDir mmcBin(QCoreApplication::applicationDirPath()); + auto items = LD_LIBRARY_PATH.split(':'); + QStringList final; + for(auto & item: items) + { + QDir test(item); + if(test == mmcBin) + { + qDebug() << "Env:LD_LIBRARY_PATH ignoring path" << item; + continue; + } + final.append(item); + } + return final.join(':'); +} + QProcessEnvironment MinecraftInstance::createEnvironment() { // prepare the process environment @@ -186,7 +204,7 @@ QProcessEnvironment MinecraftInstance::createEnvironment() } if(key == "GAME_LIBRARY_PATH") { - env.insert("LD_LIBRARY_PATH", value); + env.insert("LD_LIBRARY_PATH", processLD_LIBRARY_PATH(value)); continue; } #endif |