aboutsummaryrefslogtreecommitdiffhomepage
path: root/parser.cpp
diff options
context:
space:
mode:
authorGravatar ridiculousfish <corydoras@ridiculousfish.com>2014-03-15 13:07:19 -0700
committerGravatar ridiculousfish <corydoras@ridiculousfish.com>2014-03-15 13:07:19 -0700
commit20f9dd9a6bd5c90f7fc2304ad232bec5faebd835 (patch)
treed586eb990ecd29a8a18a7e447849cdf8d295e86d /parser.cpp
parent44e94b8cfa3baa05f6775e67666c2a253b1a1cca (diff)
Fix for extra newline that gets appended if a command is not found in
the new parser
Diffstat (limited to 'parser.cpp')
-rw-r--r--parser.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/parser.cpp b/parser.cpp
index 3febef09..69bbaa3c 100644
--- a/parser.cpp
+++ b/parser.cpp
@@ -3032,17 +3032,18 @@ void parser_t::get_backtrace(const wcstring &src, const parse_error_list_t &erro
if (filename)
{
prefix = format_string(_(L"%ls (line %lu): "), user_presentable_path(filename).c_str(), which_line);
- //append_format(*output, _(L"%ls (line %lu):\n"), user_presentable_path(filename).c_str(), which_line);
}
else
{
prefix = L"fish: ";
- //output->append(L"fish: ");
}
- output->append(err.describe_with_prefix(src, prefix, skip_caret));
- output->push_back(L'\n');
-
+ const wcstring description = err.describe_with_prefix(src, prefix, skip_caret);
+ if (! description.empty())
+ {
+ output->append(description);
+ output->push_back(L'\n');
+ }
this->stack_trace(0, *output);
}
}