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:42:39 -0400 |
commit | b11e0675b7fb3c35cd19d93511cdd926df584857 (patch) | |
tree | 0784ce01207de7d12eda2beec4e8020fa8674cfe | |
parent | c3e9f1c0a1c32a8659cb7e98e35a1274d7be9827 (diff) | |
download | b4-b11e0675b7fb3c35cd19d93511cdd926df584857.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 f0d6e07..beaaef7 100644 --- a/b4/__init__.py +++ b/b4/__init__.py @@ -923,13 +923,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 |