mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-23 08:31:16 -03:00
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:
@@ -2063,8 +2063,8 @@ void reader_import_history_if_necessary(void) {
|
||||
// Try opening a bash file. We make an effort to respect $HISTFILE; this isn't very complete
|
||||
// (AFAIK it doesn't have to be exported), and to really get this right we ought to ask bash
|
||||
// itself. But this is better than nothing.
|
||||
const env_var_t var = env_get_string(L"HISTFILE");
|
||||
wcstring path = (var.missing() ? L"~/.bash_history" : var);
|
||||
const env_var_t var = env_get(L"HISTFILE");
|
||||
wcstring path = (var.missing() ? L"~/.bash_history" : var.as_string());
|
||||
expand_tilde(path);
|
||||
FILE *f = wfopen(path, "r");
|
||||
if (f) {
|
||||
|
||||
Reference in New Issue
Block a user