aboutsummaryrefslogtreecommitdiffhomepage
path: root/env.cpp
diff options
context:
space:
mode:
authorGravatar ridiculousfish <corydoras@ridiculousfish.com>2012-05-09 03:06:10 -0700
committerGravatar ridiculousfish <corydoras@ridiculousfish.com>2012-05-09 03:06:10 -0700
commit175249b4555afd7e453d5bd5a054bb79f3577fe1 (patch)
treec2002dfc8e186dfab1cbc3315e82d0f33ebed913 /env.cpp
parent294fbc830918f49dd13500bdf0fb4f4933338023 (diff)
Adopt wcstring in env_set
Diffstat (limited to 'env.cpp')
-rw-r--r--env.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/env.cpp b/env.cpp
index c6373cdf..f35c9aa5 100644
--- a/env.cpp
+++ b/env.cpp
@@ -728,7 +728,7 @@ static env_node_t *env_get_node( const wcstring &key )
return env;
}
-int env_set(const wchar_t *key, const wchar_t *val, int var_mode)
+int env_set(const wcstring &key, const wchar_t *val, int var_mode)
{
ASSERT_IS_MAIN_THREAD();
env_node_t *node = NULL;
@@ -738,8 +738,6 @@ int env_set(const wchar_t *key, const wchar_t *val, int var_mode)
int done=0;
int is_universal = 0;
-
- CHECK( key, ENV_INVALID );
if( val && contains( key, L"PWD", L"HOME" ) )
{
@@ -756,7 +754,7 @@ int env_set(const wchar_t *key, const wchar_t *val, int var_mode)
return ENV_PERM;
}
- if( wcscmp( key, L"umask" ) == 0)
+ if (key == L"umask")
{
wchar_t *end;
int mask;
@@ -804,7 +802,7 @@ int env_set(const wchar_t *key, const wchar_t *val, int var_mode)
exportv = (var_mode & ENV_EXPORT );
}
- env_universal_set( key, val, exportv );
+ env_universal_set(key, val, exportv);
is_universal = 1;
}
@@ -861,7 +859,7 @@ int env_set(const wchar_t *key, const wchar_t *val, int var_mode)
exportv = (var_mode & ENV_EXPORT );
}
- env_universal_set( key, val, exportv );
+ env_universal_set(key, val, exportv);
is_universal = 1;
done = 1;