aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar ridiculousfish <corydoras@ridiculousfish.com>2014-01-12 13:42:26 -0800
committerGravatar ridiculousfish <corydoras@ridiculousfish.com>2014-01-12 13:42:26 -0800
commitb2c78dbd57a7c891aa176f1a571f36bd765e9ffb (patch)
treee009d6edfb05812cdef5941897986c8c48649c6d
parent89069fdaa4fff2f8b703fef0be260eb4d4c2ed9b (diff)
Fix for issue where we compute a default USER variable, but never set
its value.
-rw-r--r--env.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/env.cpp b/env.cpp
index acf132c8..ab7f63e5 100644
--- a/env.cpp
+++ b/env.cpp
@@ -299,7 +299,6 @@ static bool var_is_locale(const wcstring &key)
static void handle_locale()
{
const env_var_t lc_all = env_get_string(L"LC_ALL");
- int i;
const wcstring old_locale = wsetlocale(LC_MESSAGES, NULL);
/*
@@ -330,7 +329,7 @@ static void handle_locale()
wsetlocale(LC_ALL, lang.c_str());
}
- for (i=2; locale_variable[i]; i++)
+ for (int i=2; locale_variable[i]; i++)
{
const env_var_t val = env_get_string(locale_variable[i]);
@@ -479,7 +478,7 @@ static void env_set_defaults()
if (pw->pw_name != NULL)
{
const wcstring wide_name = str2wcstring(pw->pw_name);
- env_set(L"USER", NULL, ENV_GLOBAL);
+ env_set(L"USER", wide_name.c_str(), ENV_GLOBAL);
}
}