From 5fc5cf0b5eb66f63d333fae63610a651b0368c59 Mon Sep 17 00:00:00 2001 From: Konstantin Ryabitsev Date: Tue, 18 Aug 2020 11:52:39 -0400 Subject: Require that a trailer is at least 2 chars long I can't think of any trailers that are shorter than 2 characters, so tweak the regex to avoid one of the possible false positives. Reported-by: Jonathan Corbet Signed-off-by: Konstantin Ryabitsev --- b4/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/b4/__init__.py b/b4/__init__.py index cd07be0..e19ec90 100644 --- a/b4/__init__.py +++ b/b4/__init__.py @@ -887,7 +887,7 @@ class LoreMessage: self.trailers.add(('Fixes', tvalue)) # Do we have something that looks like a person-trailer? - matches = re.findall(r'^\s*([\w-]+):[ \t]+(.*<\S+>)\s*$', self.body, re.MULTILINE) + matches = re.findall(r'^\s*([\w-]{2,}):[ \t]+(.*<\S+>)\s*$', self.body, re.MULTILINE) # These are commonly part of patch/commit metadata badtrailers = ('from', 'author', 'cc') if matches: -- cgit v1.2.3