Platform: prefers the passwd shell over $SHELL

This commit is contained in:
Carter Li
2026-10-07 14:06:56 +08:00
parent 66709ccc77
commit 9859b248ff
+1 -4
View File
@@ -299,10 +299,7 @@ static void getHostName(FFPlatform* platform, const struct utsname* uts) {
} }
static void getUserShell(FFPlatform* platform, const struct passwd* pwd) { static void getUserShell(FFPlatform* platform, const struct passwd* pwd) {
const char* shell = getenv("SHELL"); const char* shell = pwd ? pwd->pw_shell : getenv("SHELL");
if (!ffStrSet(shell) && pwd) {
shell = pwd->pw_shell;
}
ffStrbufAppendS(&platform->userShell, shell); ffStrbufAppendS(&platform->userShell, shell);
} }