Start numbering lines at 1

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
This commit is contained in:
Gilles Peskine 2020-03-27 19:42:38 +01:00
parent eebf24f7a8
commit e248e83f9f

View file

@ -216,14 +216,14 @@ class ChangeLog:
self.categories = OrderedDict() self.categories = OrderedDict()
for category in STANDARD_CATEGORIES: for category in STANDARD_CATEGORIES:
self.categories[category] = b'' self.categories[category] = b''
offset = (self.header + self.top_version_title).count(b'\n') offset = (self.header + self.top_version_title).count(b'\n') + 1
self.add_categories_from_text(input_stream.name, offset, self.add_categories_from_text(input_stream.name, offset,
top_version_body, True) top_version_body, True)
def add_file(self, input_stream): def add_file(self, input_stream):
"""Add changelog entries from a file. """Add changelog entries from a file.
""" """
self.add_categories_from_text(input_stream.name, 0, self.add_categories_from_text(input_stream.name, 1,
input_stream.read(), False) input_stream.read(), False)
def write(self, filename): def write(self, filename):