0
0
mirror of https://github.com/termux/termux-packages.git synced 2024-11-21 20:56:19 +00:00
termux-packages/disabled-packages/fex/Source-Common-Config.patch
tqfx 740eea08b5
fex: Disabled (#19893)
* bump(main/fex): 202404

* fex: Disabled
  Refer https://wiki.fex-emu.com/index.php/Termux
2024-04-24 20:01:29 +08:00

35 lines
1.1 KiB
Diff

diff --git a/Source/Common/Config.cpp b/Source/Common/Config.cpp
index 1430479..67ca3e7 100644
--- a/Source/Common/Config.cpp
+++ b/Source/Common/Config.cpp
@@ -392,6 +392,7 @@ namespace JSON {
FEXCore::Config::Load();
auto Args = FEX::ArgLoader::Get();
+ size_t i = 0;
if (LoadProgramConfig) {
if (Args.empty()) {
@@ -399,8 +400,19 @@ namespace JSON {
return {};
}
- Args[0] = RecoverGuestProgramFilename(std::move(Args[0]), ExecFDInterp, ProgramFDFromEnv);
- fextl::string& Program = Args[0];
+ // really bad workaround for Termux Proot
+ for (size_t j=0; j<Args.size(); j++) {
+ if (Args[j] == "-U") continue;
+ if (Args[j] == "LD_LIBRARY_PATH") continue;
+ if (Args[j] == "-E") continue;
+ if (Args[j] == "LD_PRELOAD=") continue;
+ if (Args[j] == "-0") continue;
+ i=j;
+ break;
+ }
+
+ Args[i] = RecoverGuestProgramFilename(std::move(Args[i]), ExecFDInterp, ProgramFDFromEnv);
+ fextl::string& Program = Args[i];
bool Wine = false;
fextl::string ProgramName;