commit 07fd4c45988aa4993e1e93a84f317d3b977def7f
parent 44fb3e9991cbc2f428efd9d9ae8567ff866d19d9
Author: Benno Schulenberg <bensberg@telfort.nl>
Date: Fri, 7 May 2021 12:40:25 +0200
tweaks: condense and correct a comment, and move another
Since commit 5dcf375f from four years ago, a linter message must
contain a colon followed by a space for it to be recognized as a
linter message.
Diffstat:
1 file changed, 3 insertions(+), 6 deletions(-)
diff --git a/src/text.c b/src/text.c
@@ -2631,10 +2631,10 @@ void do_linter(void)
block_sigwinch(FALSE);
- /* Process the linter output. */
pointer = lintings;
onelint = lintings;
+ /* Now parse the output of the linter. */
while (*pointer != '\0') {
if ((*pointer == '\r') || (*pointer == '\n')) {
*pointer = '\0';
@@ -2642,11 +2642,8 @@ void do_linter(void)
char *filename = NULL, *linestr = NULL, *maybecol = NULL;
char *message = copy_of(onelint);
- /* At the moment we handle the following formats:
- *
- * filenameorcategory:line:column:message (e.g. splint)
- * filenameorcategory:line,column:message (e.g. pylint)
- * filenameorcategory:line:message (e.g. pyflakes) */
+ /* 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 ((linestr = strtok(NULL, ":")) != NULL) {