quickfix: qf_parse_fmt_plus never fails

This commit is contained in:
Jan Edmund Lazo 2019-12-25 07:02:45 -05:00
parent 0be59d2b5e
commit 6a0242beea
No known key found for this signature in database
GPG Key ID: 64915E6E9F735B15

View File

@ -1341,9 +1341,10 @@ static int qf_parse_fmt_t(regmatch_T *rmp, int midx, qffields_T *fields)
/// Parse the match for '%+' format pattern. The whole matching line is included
/// in the error string. Return the matched line in "fields->errmsg".
static int qf_parse_fmt_plus(char_u *linebuf,
size_t linelen,
qffields_T *fields)
static void qf_parse_fmt_plus(const char_u *linebuf,
size_t linelen,
qffields_T *fields)
FUNC_ATTR_NONNULL_ALL
{
if (linelen >= fields->errmsglen) {
// linelen + null terminator
@ -1351,7 +1352,6 @@ static int qf_parse_fmt_plus(char_u *linebuf,
fields->errmsglen = linelen + 1;
}
STRLCPY(fields->errmsg, linebuf, linelen + 1);
return QF_OK;
}
/// Parse the match for error message ('%m') pattern in regmatch.
@ -1508,7 +1508,7 @@ static int qf_parse_match(char_u *linebuf, size_t linelen, efm_T *fmt_ptr,
status = qf_parse_fmt_f(regmatch, midx, fields, idx);
} else if (i == 5) {
if (fmt_ptr->flags == '+' && !qf_multiscan) { // %+
status = qf_parse_fmt_plus(linebuf, linelen, fields);
qf_parse_fmt_plus(linebuf, linelen, fields);
} else if (midx > 0) { // %m
status = qf_parse_fmt_m(regmatch, midx, fields);
}