diff options
author | Konstantin Ryabitsev <konstantin@linuxfoundation.org> | 2021-06-09 11:41:04 -0400 |
---|---|---|
committer | Konstantin Ryabitsev <konstantin@linuxfoundation.org> | 2021-06-09 11:41:04 -0400 |
commit | 9496a6e8fc4682676b016c83c41c358deabbab9b (patch) | |
tree | 89a50d6c6d8373aa698c38320ab97e90446f7f91 | |
parent | c878da206452b3839c3fd180633d2d20be69e58f (diff) | |
download | b4-9496a6e8fc4682676b016c83c41c358deabbab9b.tar.gz |
Fix sloppy trailer handling
When returning sloppy trailers, make sure we always return a 4-member
list, which includes the provenant LoreMessage itself.
Reported-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
-rw-r--r-- | b4/__init__.py | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/b4/__init__.py b/b4/__init__.py index cad22b7..d69f80e 100644 --- a/b4/__init__.py +++ b/b4/__init__.py @@ -929,13 +929,11 @@ class LoreMessage: self.trailers.append(trailer) def get_trailers(self, sloppy=False): + trailers = list() mismatches = set() - if sloppy: - return self.trailers, mismatches - trailers = list() for tname, tvalue, extdata in self.trailers: - if tname.lower() in ('fixes', 'obsoleted-by'): + if sloppy or tname.lower() in ('fixes', 'obsoleted-by'): trailers.append((tname, tvalue, extdata, self)) continue |