commit 5dcf375f33fb040a927a2664392134a8694e9997
parent 50379cc4ff39fdf739607640c476069f99b5520b
Author: Benno Schulenberg <bensberg@telfort.nl>
Date: Fri, 28 Jul 2017 21:26:23 +0200
linting: skip the introductory message produced by 'gcc -fshow-column'
Assume that a linter line that contains an actual error message or
warning includes a colon followed by a space -- something that that
opening message from a modern gcc lacks.
Diffstat:
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/text.c b/src/text.c
@@ -3152,7 +3152,8 @@ void do_linter(void)
* filenameorcategory:line,column:message (e.g. pylint)
* filenameorcategory:line:message (e.g. pyflakes)
*/
- if ((filename = strtok(read_buff_word, ":")) != NULL) {
+ if (strstr(message, ": ") != NULL) {
+ filename = strtok(read_buff_word, ":");
if ((linestr = strtok(NULL, ":")) != NULL) {
if ((maybecol = strtok(NULL, ":")) != NULL) {
ssize_t tmplineno = 0, tmpcolno = 0;