summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2010-09-21 01:40:34 +0200
committerLennart Poettering <lennart@poettering.net>2010-09-21 01:40:34 +0200
commit8780d48d86d921a8245febdde7888cd89ad3631b (patch)
tree5e59e82764c9cd847cab66742637794ff3a73eca /src
parent97e3d13fb4d28e25803f1a6543ae2051b5fcff1d (diff)
locale: unset locale vars that are not set any longer
Diffstat (limited to 'src')
-rw-r--r--src/locale-setup.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/locale-setup.c b/src/locale-setup.c
index ae7529801b..8ead9fdd9d 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: