mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-29 06:01:16 -03:00
Eliminate global variables associated with builtin IO
This change eliminates global variables like stdout_buffer. Instead we wrap up the IO information into a new struct io_streams_t, and thread that through every builtin. This makes the intent clearer, gives us a place to hang new IO data, and eliminates the ugly global state management like builtin_push_io.
This commit is contained in:
@@ -410,7 +410,8 @@ parse_execution_result_t parse_execution_context_t::run_function_statement(const
|
||||
const wcstring contents_str = wcstring(this->src, contents_start, contents_end - contents_start);
|
||||
int definition_line_offset = this->line_offset_of_character_at_offset(contents_start);
|
||||
wcstring error_str;
|
||||
int err = define_function(*parser, argument_list, contents_str, definition_line_offset, &error_str);
|
||||
io_streams_t streams;
|
||||
int err = define_function(*parser, streams, argument_list, contents_str, definition_line_offset, &error_str);
|
||||
proc_set_last_status(err);
|
||||
|
||||
if (! error_str.empty())
|
||||
|
||||
Reference in New Issue
Block a user