summaryrefslogtreecommitdiff
path: root/src/locale-setup.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/locale-setup.c')
-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: