clearing the env isn't needed anymore (afaik)

This commit is contained in:
Kinzie 2024-04-15 23:05:12 +01:00
parent 384b19a46c
commit 7cc6fbaee3
1 changed files with 1 additions and 10 deletions

View File

@ -107,19 +107,12 @@ pub fn authenticate(allocator: Allocator, config: Config, desktop: Desktop, logi
std.os.exit(1);
}
// Set up the environment (this clears the currently set one)
// Set up the environment
initEnv(allocator, pwd, config.path) catch |e| {
shared_err.writeError(e);
std.os.exit(1);
};
// Reset the XDG environment variables from before
setXdgSessionEnv(current_environment.display_server);
setXdgEnv(allocator, tty_str, current_environment.xdg_name) catch |e| {
shared_err.writeError(e);
std.os.exit(1);
};
// Set the PAM variables
const pam_env_vars = interop.pam.pam_getenvlist(handle);
var index: usize = 0;
@ -191,8 +184,6 @@ pub fn authenticate(allocator: Allocator, config: Config, desktop: Desktop, logi
fn initEnv(allocator: Allocator, pwd: *interop.passwd, path: ?[]const u8) !void {
const term_env = std.os.getenv("TERM");
std.c.environ[0] = null;
if (term_env) |term| _ = interop.setenv("TERM", term, 1);
_ = interop.setenv("HOME", pwd.pw_dir, 1);
_ = interop.setenv("PWD", pwd.pw_dir, 1);