From: Ralph Corderoy Date: Tue, 9 May 2017 21:48:11 +0000 (+0100) Subject: sbr/mf.c: Simplify isat(); it's /^ at /i. X-Git-Url: https://diplodocus.org/git/nmh/commitdiff_plain/d8f618fee89be7c25e9cc232a358d2d2b1ed53ac?hp=7cca9c4da3b90561d4cdf7de97f534d6c98ae1f4 sbr/mf.c: Simplify isat(); it's /^ at /i. This one's for all those RFC 733 emails out there. You know who you are. --- diff --git a/sbr/mf.c b/sbr/mf.c index 4d04abb6..33eed0d1 100644 --- a/sbr/mf.c +++ b/sbr/mf.c @@ -24,8 +24,10 @@ static int my_lex (char *); static int isat (const char *p) { - return has_prefix(p, " AT ") || has_prefix(p, " At ") || - has_prefix(p, " aT ") || has_prefix(p, " at "); + return *p == ' ' && + (p[1] == 'a' || p[1] == 'A') && + (p[2] == 't' || p[2] == 'T') && + p[3] == ' '; }