1
1

linter: adjust the parsing to accommodate for a modern 'pyflakes'

In version 2.2.0, pyflakes changed its output format,
from 'filename:line: text' to 'filename:line:column text'.

This fixes https://savannah.gnu.org/bugs/?62057.

Problem existed since version 2.9.0, commit 5dcf375f.

(That commit tried to compensate for an introductory message from gcc
that no longer seems to exist.)
Этот коммит содержится в:
Benno Schulenberg 2022-02-16 15:29:35 +01:00
родитель 89bb88e4f5
Коммит 8fccb31436

Просмотреть файл

@ -2652,10 +2652,9 @@ void do_linter(void)
/* The recognized format is "filename:line:column: message",
* where ":column" may be absent or be ",column" instead. */
if (strstr(message, ": ") != NULL) {
filename = strtok(onelint, ":");
if ((filename = strtok(onelint, ":")) != NULL) {
if ((linestr = strtok(NULL, ":")) != NULL) {
if ((maybecol = strtok(NULL, ":")) != NULL) {
if ((maybecol = strtok(NULL, " ")) != NULL) {
ssize_t tmplineno = 0, tmpcolno = 0;
char *tmplinecol;
@ -2684,7 +2683,7 @@ void do_linter(void)
curlint->prev = tmplint;
if (curlint->prev != NULL)
curlint->prev->next = curlint;
curlint->msg = copy_of(strstr(message, ": ") + 2);
curlint->msg = copy_of(strstr(message, " ") + 1);
curlint->lineno = tmplineno;
curlint->colno = tmpcolno;
curlint->filename = copy_of(filename);