aboutsummaryrefslogtreecommitdiff
path: root/filters
diff options
context:
space:
mode:
authorRobin Jarry <robin@jarry.cc>2023-11-20 10:20:20 +0100
committerRobin Jarry <robin@jarry.cc>2023-12-04 17:03:45 +0100
commitc67723bcfbd5d181f2270bc25b691d6f6312a0c1 (patch)
tree2908bcdb169f6574cd89be056dbb46f05b58a1b8 /filters
parent0d98bb7f2418e3b73d8405c7674200778d3fbe0f (diff)
downloadaerc-c67723bcfbd5d181f2270bc25b691d6f6312a0c1.tar.gz
aerc-c67723bcfbd5d181f2270bc25b691d6f6312a0c1.zip
colorize: only colorize real usenet signatures
Only consider the start of a signature if a line is exactly "-- " with a trailing space character. Signed-off-by: Robin Jarry <robin@jarry.cc> Tested-by: Johannes Thyssen Tishman <johannes@thyssentishman.com>
Diffstat (limited to 'filters')
-rw-r--r--filters/colorize.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/filters/colorize.c b/filters/colorize.c
index cf6b8402..1c4f8c63 100644
--- a/filters/colorize.c
+++ b/filters/colorize.c
@@ -2,7 +2,6 @@
/* Copyright (c) 2023 Robin Jarry */
#include <ctype.h>
-#include <errno.h>
#include <fnmatch.h>
#include <getopt.h>
#include <regex.h>
@@ -657,7 +656,7 @@ static void colorize_line(const char *in)
switch (state) {
case DIFF:
- if (!strcmp(in, "--") || !strcmp(in, "-- ")) {
+ if (!strcmp(in, "-- ")) {
state = SIGNATURE;
signature(in);
} else if (startswith(in, "@@ ")) {
@@ -686,7 +685,7 @@ static void colorize_line(const char *in)
if (!regexec(&diff_start_re, in, 8, groups, 0)) {
state = DIFF;
print_style(in, &styles.diff_meta);
- } else if (!strcmp(in, "--") || !strcmp(in, "-- ")) {
+ } else if (!strcmp(in, "-- ")) {
state = SIGNATURE;
signature(in);
} else {