fix issues with builtin_function()

This does several things. It fixes `builtin_function()` so that errors it
emits are displayed. As part of doing that I've removed the unnecessary
`out_err` parameter to make the interface like every other builtin.

This also fixes a regression introduced by #4000 which was attempting to
fix a bug introduced by #3649.

Fixes #4139
This commit is contained in:
Kurtis Rader
2017-06-17 22:36:56 -07:00
parent 0e954e4764
commit 385e40540c
7 changed files with 38 additions and 45 deletions

View File

@@ -1966,7 +1966,7 @@ parser_test_error_bits_t reader_shell_test(const wchar_t *b) {
if (res & PARSER_TEST_ERROR) {
wcstring error_desc;
parser_t::principal_parser().get_backtrace(bstr, errors, &error_desc);
parser_t::principal_parser().get_backtrace(bstr, errors, error_desc);
// Ensure we end with a newline. Also add an initial newline, because it's likely the user
// just hit enter and so there's junk on the current line.
@@ -3315,7 +3315,7 @@ static int read_ni(int fd, const io_chain_t &io) {
parser.eval(str, io, TOP, std::move(tree));
} else {
wcstring sb;
parser.get_backtrace(str, errors, &sb);
parser.get_backtrace(str, errors, sb);
fwprintf(stderr, L"%ls", sb.c_str());
res = 1;
}