Fix a "loop will execute at most once" warning

This commit is contained in:
ridiculousfish 2016-10-01 18:03:44 -07:00
parent c0c2e1d4fa
commit cd84587c3a

View file

@ -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) {