From 8780d48d86d921a8245febdde7888cd89ad3631b Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Tue, 21 Sep 2010 01:40:34 +0200 Subject: [PATCH] locale: unset locale vars that are not set any longer --- src/locale-setup.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/locale-setup.c b/src/locale-setup.c index ae7529801..8ead9fdd9 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: -- 2.30.2