diff options
author | 2014-02-20 10:57:13 -0800 | |
---|---|---|
committer | 2014-02-20 10:57:13 -0800 | |
commit | adf5b036d646561dbcd7d3d5d04ab7a0e6827a87 (patch) | |
tree | 990f17d0ac56a59bcd1a2ee3c2a770d5eb32329a /parser.cpp | |
parent | 3ab954644fb8c0997a4eeb6830e8e342de5aff8a (diff) |
Fix to stop reporting config.fish execution as coming from "standard
input" within backtraces
Diffstat (limited to 'parser.cpp')
-rw-r--r-- | parser.cpp | 31 |
1 files changed, 21 insertions, 10 deletions
@@ -299,6 +299,7 @@ parser_t::parser_t(enum parser_type_t type, bool errors) : error_code(0), err_pos(0), cancellation_requested(false), + is_within_fish_initialization(false), current_tokenizer(NULL), current_tokenizer_pos(0), job_start_pos(0), @@ -322,6 +323,11 @@ parser_t &parser_t::principal_parser(void) return parser; } +void parser_t::set_is_within_fish_initialization(bool flag) +{ + is_within_fish_initialization = flag; +} + void parser_t::skip_all_blocks(void) { /* Tell all blocks to skip */ @@ -858,10 +864,13 @@ void parser_t::stack_trace(size_t block_idx, wcstring &buff) const b->src_lineno, user_presentable_path(file).c_str()); } + else if (is_within_fish_initialization) + { + append_format(buff, _(L"\tcalled during startup\n")); + } else { - append_format(buff, - _(L"\tcalled on standard input\n")); + append_format(buff, _(L"\tcalled on standard input\n")); } if (b->type() == FUNCTION_CALL) @@ -1064,15 +1073,17 @@ const wchar_t *parser_t::current_line() { int prev_width = my_wcswidth(lineinfo.c_str()); if (file) - append_format(lineinfo, - _(L"%ls (line %d): "), - file, - lineno); + { + append_format(lineinfo, _(L"%ls (line %d): "), file, lineno); + } + else if (is_within_fish_initialization) + { + append_format(lineinfo, L"%ls: ", _(L"Startup"), lineno); + } else - append_format(lineinfo, - L"%ls: ", - _(L"Standard input"), - lineno); + { + append_format(lineinfo, L"%ls: ", _(L"Standard input"), lineno); + } offset = my_wcswidth(lineinfo.c_str()) - prev_width; } else |