stop subclassing env_var_t from wcstring

This is the first step to implementing issue #4200 is to stop subclassing
env_var_t from wcstring. Not too surprisingly doing this identified
several places that were incorrectly treating env_var_t and wcstring as
interchangeable types. I'm not talking about those places that passed
an env_var_t instance to a function that takes a wcstring. I'm talking
about doing things like assigning the former to the latter type, relying
on the implicit conversion, and thus losing information.

We also rename `env_get_string()` to `env_get()` for symmetry with
`env_set()` and to make it clear the function does not return a string.
This commit is contained in:
Kurtis Rader
2017-08-05 18:22:49 -07:00
parent d87c0424d8
commit c36ad27618
22 changed files with 205 additions and 186 deletions

View File

@@ -201,8 +201,8 @@ static int input_function_args_index = 0;
/// Return the current bind mode.
wcstring input_get_bind_mode() {
env_var_t mode = env_get_string(FISH_BIND_MODE_VAR);
return mode.missing() ? DEFAULT_BIND_MODE : mode;
env_var_t mode = env_get(FISH_BIND_MODE_VAR);
return mode.missing() ? DEFAULT_BIND_MODE : mode.as_string();
}
/// Set the current bind mode.