diff options
author | 2014-07-13 19:08:15 -0700 | |
---|---|---|
committer | 2014-08-21 19:06:21 -0700 | |
commit | 9f725bee1f59df961e93e3d2392bc779281d7de7 (patch) | |
tree | b859c757b7c14e4fafb03fef990706e1c2a950b6 /builtin_set.cpp | |
parent | d0c85471b40fee548efc35a370f5d5c4b656f66a (diff) |
set: Print an error when setting `umask` to a bad value
Repurpose the ENV_INVALID return value for env_set(), which wasn't
currently used by anything. When a bad value is passed for the 'umask'
key, return ENV_INVALID to signal this and print a good error message
from the `set` builtin.
This makes `set umask foo` properly produce an error.
Diffstat (limited to 'builtin_set.cpp')
-rw-r--r-- | builtin_set.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/builtin_set.cpp b/builtin_set.cpp index af257d16..eb4f5eda 100644 --- a/builtin_set.cpp +++ b/builtin_set.cpp @@ -166,7 +166,7 @@ static int my_env_set(const wchar_t *key, const wcstring_list_t &val, int scope) case ENV_INVALID: { - append_format(stderr_buffer, _(L"%ls: Unknown error"), L"set"); + append_format(stderr_buffer, _(L"%ls: Tried to set the special variable '%ls' to an invalid value\n"), L"set", key); retcode=1; break; } |