mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-26 04:43:10 +00:00
Fix a "loop will execute at most once" warning
This commit is contained in:
parent
c0c2e1d4fa
commit
cd84587c3a
1 changed files with 3 additions and 4 deletions
|
@ -545,12 +545,11 @@ expression *test_parser::parse_args(const wcstring_list_t &args, wcstring &err)
|
|||
expression *result = parser.parse_expression(0, (unsigned int)args.size());
|
||||
|
||||
// Handle errors.
|
||||
for (size_t i = 0; i < parser.errors.size(); i++) {
|
||||
err.append(L"test: ");
|
||||
err.append(parser.errors.at(i));
|
||||
err.push_back(L'\n');
|
||||
// For now we only show the first error.
|
||||
break;
|
||||
if (! parser.errors.empty()) {
|
||||
err.append(L"test: ");
|
||||
err.append(parser.errors.at(0));
|
||||
err.push_back(L'\n');
|
||||
}
|
||||
|
||||
if (result) {
|
||||
|
|
Loading…
Reference in a new issue