mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-17 02:41:15 -03:00
Eliminate wopen()
It was large and mostly unnecessary. Prefer wopen() followed by fdopen().
This commit is contained in:
@@ -2174,8 +2174,9 @@ void reader_import_history_if_necessary() {
|
||||
const auto var = data->vars().get(L"HISTFILE");
|
||||
wcstring path = (var ? var->as_string() : L"~/.bash_history");
|
||||
expand_tilde(path, data->vars());
|
||||
FILE *f = wfopen(path, "r");
|
||||
if (f) {
|
||||
int fd = wopen_cloexec(path, O_RDONLY);
|
||||
if (fd >= 0) {
|
||||
FILE *f = fdopen(fd, "r");
|
||||
data->history->populate_from_bash(f);
|
||||
fclose(f);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user