diff options
author | Robin Jarry <robin@jarry.cc> | 2023-11-20 10:20:20 +0100 |
---|---|---|
committer | Robin Jarry <robin@jarry.cc> | 2023-12-04 17:03:45 +0100 |
commit | c67723bcfbd5d181f2270bc25b691d6f6312a0c1 (patch) | |
tree | 2908bcdb169f6574cd89be056dbb46f05b58a1b8 /filters | |
parent | 0d98bb7f2418e3b73d8405c7674200778d3fbe0f (diff) | |
download | aerc-c67723bcfbd5d181f2270bc25b691d6f6312a0c1.tar.gz |
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.c | 5 |
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 { |