Skip to content

Free fork of NotProton: Windows Steam games in Mac Steam, on CodeWeavers' Wine and Apple's Game Porting Toolkit

fix(native-launch): unset STEAM_DYLD_INSERT_LIBRARIES when no library is left

kevicebryand00fecfaba8a
diff --git a/native-launch/np-native.c b/native-launch/np-native.c
index c4cfeff..f24d778 100644
--- a/native-launch/np-native.c
+++ b/native-launch/np-native.c
@@ -509,6 +509,7 @@ int main(int argc, char **argv)
xsetenv("STEAM_DYLD_INSERT_LIBRARIES", dyld);
} else {
unsetenv("DYLD_INSERT_LIBRARIES");
+ unsetenv("STEAM_DYLD_INSERT_LIBRARIES");
}
const char *log = getenv("NP_NATIVE_LOG");
diff --git a/native-launch/tests/run.sh b/native-launch/tests/run.sh
index 0a66941..ecb6f88 100644
--- a/native-launch/tests/run.sh
+++ b/native-launch/tests/run.sh
@@ -146,6 +146,9 @@ expect "dyld: user list between ours and Steam's" \
"DYLD_INSERT_LIBRARIES=$pad:$tmp/libs/user.dylib:$steamlib" "loaded:user"
run "$V" -- NP_PAD_MODE=off "$probe"
expect "dyld: nothing to inject leaves it unset" "DYLD_INSERT_LIBRARIES=(unset)"
+run "$V" "STEAM_DYLD_INSERT_LIBRARIES=$tmp/libs/missing.dylib" -- NP_PAD_MODE=off "$probe"
+expect "dyld: a STEAM_DYLD_ list of missing libraries is unset too" \
+ "DYLD_INSERT_LIBRARIES=(unset)" "STEAM_DYLD_INSERT_LIBRARIES=(unset)"
# shell-script games (dota.sh): SIP strips DYLD_* in /bin/sh, the script
# restores it from STEAM_DYLD_INSERT_LIBRARIES