From: Lennart Poettering Date: Mon, 20 Sep 2010 23:40:34 +0000 (+0200) Subject: locale: unset locale vars that are not set any longer X-Git-Tag: v11~116 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8780d48d86d921a8245febdde7888cd89ad3631b;p=systemd locale: unset locale vars that are not set any longer --- diff --git a/src/locale-setup.c b/src/locale-setup.c index ae752980..8ead9fdd 100644 --- a/src/locale-setup.c +++ b/src/locale-setup.c @@ -166,15 +166,15 @@ int locale_setup(void) { for (i = 0; i < _VARIABLE_MAX; i++) { - if (!variables[i]) - continue; - - if (setenv(variable_names[i], variables[i], 1) < 0) { - r = -errno; - goto finish; - } - + if (variables[i]) { + if (setenv(variable_names[i], variables[i], 1) < 0) { + r = -errno; + goto finish; + } + } else + unsetenv(variable_names[i]); } + r = 0; finish: