From 635e9f5eb824c73e7c8045b9462352328c5bd6d5 Mon Sep 17 00:00:00 2001 From: Przemyslaw Gorszkowski Date: Mon, 26 Apr 2021 09:32:37 +0200 Subject: [PATCH] LineFilterProgressHandler: fix parsing line which ends with CR only --- lib/bb/progress.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/bb/progress.py b/lib/bb/progress.py index d051ba0198..52d704d642 100644 --- a/lib/bb/progress.py +++ b/lib/bb/progress.py @@ -94,12 +94,15 @@ def write(self, string): while True: breakpos = self._linebuffer.find('\n') + 1 if breakpos == 0: - break + # for the case when the line with progress ends with only '\r' + breakpos = self._linebuffer.find('\r') + 1 + if breakpos == 0: + break line = self._linebuffer[:breakpos] self._linebuffer = self._linebuffer[breakpos:] # Drop any line feeds and anything that precedes them lbreakpos = line.rfind('\r') + 1 - if lbreakpos: + if lbreakpos and lbreakpos != breakpos: line = line[lbreakpos:] if self.writeline(filter_color(line)): super().write(line)