mirror of https://github.com/fairyglade/ly.git
login.c: Do not overwrite the PATH variable if config.path element is empty (#135)
This allows disabling the feature if PATH was already set (e.g. by the systemd session slice) and the user wishes to honor that. Signed-off-by: Roosembert Palacios <roosembert.palacios@epfl.ch>
This commit is contained in:
parent
fe4af2bfe6
commit
f650e82f93
13
src/login.c
13
src/login.c
|
@ -229,12 +229,15 @@ void env_init(struct passwd* pwd, const char* display_name)
|
||||||
setenv("DISPLAY", display_name, 1);
|
setenv("DISPLAY", display_name, 1);
|
||||||
setenv("LANG", lang, 1);
|
setenv("LANG", lang, 1);
|
||||||
|
|
||||||
// path
|
// Set PATH if specified in the configuration
|
||||||
int ok = setenv("PATH", config.path, 1);
|
if (strlen(config.path))
|
||||||
|
|
||||||
if (ok != 0)
|
|
||||||
{
|
{
|
||||||
dgn_throw(DGN_PATH);
|
int ok = setenv("PATH", config.path, 1);
|
||||||
|
|
||||||
|
if (ok != 0)
|
||||||
|
{
|
||||||
|
dgn_throw(DGN_PATH);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue