aboutsummaryrefslogtreecommitdiffhomepage
path: root/env.h
diff options
context:
space:
mode:
authorGravatar Kevin Ballard <kevin@sb.org>2014-07-13 19:08:15 -0700
committerGravatar ridiculousfish <corydoras@ridiculousfish.com>2014-08-21 19:06:21 -0700
commit9f725bee1f59df961e93e3d2392bc779281d7de7 (patch)
treeb859c757b7c14e4fafb03fef990706e1c2a950b6 /env.h
parentd0c85471b40fee548efc35a370f5d5c4b656f66a (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 'env.h')
-rw-r--r--env.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/env.h b/env.h
index 7afa9b9c..8d4a41a9 100644
--- a/env.h
+++ b/env.h
@@ -80,7 +80,7 @@ void env_init(const struct config_paths_t *paths = NULL);
* ENV_PERM, can only be returned when setting as a user, e.g. ENV_USER is set. This means that the user tried to change a read-only variable.
* ENV_SCOPE, the variable cannot be set in the given scope. This applies to readonly/electric variables set from the local or universal scopes, or set as exported.
- * ENV_INVALID, the variable name or mode was invalid
+ * ENV_INVALID, the variable value was invalid. This applies only to special variables.
*/
int env_set(const wcstring &key, const wchar_t *val, env_mode_flags_t mode);