mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-05-21 19:41:14 -03:00
Fix to restore an optimization from parse_util_get_line_from_offset in a more thread-safe way
This commit is contained in:
@@ -192,7 +192,7 @@ void function_add( const function_data_t &data, const parser_t &parser )
|
||||
|
||||
/* Create and store a new function */
|
||||
const wchar_t *filename = reader_current_filename();
|
||||
int def_offset = parse_util_lineno( parser.get_buffer(), parser.current_block->tok_pos )-1;
|
||||
int def_offset = parser.line_number_of_character_at_offset(parser.current_block->tok_pos) - 1;
|
||||
const function_map_t::value_type new_pair(data.name, function_info_t(data, filename, def_offset, is_autoload));
|
||||
loaded_functions.insert(new_pair);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user