mirror of https://github.com/fairyglade/ly.git
login.c: Do not overwrite the PATH variable if config.path element is empty
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
1796a355bc
commit
04c67a6bde
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