summaryrefslogtreecommitdiff
path: root/add-interactive.h
diff options
context:
space:
mode:
authorLibravatar Jiang Xin <worldhello.net@gmail.com>2021-06-17 11:17:24 +0800
committerLibravatar Junio C Hamano <gitster@pobox.com>2021-06-17 14:11:36 +0900
commit5210225f256d01938960d439bff9d809c2ff1809 (patch)
tree3fcbde188fad6d51627233e11e8a6c5f156dd58f /add-interactive.h
parentThe second batch (diff)
downloadtgif-5210225f256d01938960d439bff9d809c2ff1809.tar.xz
sideband: don't lose clear-to-eol at packet boundary
When "demultiplex_sideband()" sees a nonempty message ending with CR or LF on the sideband #2, it adds "suffix" string to clear to the end of the current line, which helps when relaying a progress display whose records are terminated with CRs. But if it sees a single LF, no clear-to-end suffix should be appended, because this single LF is used to end the progress display by moving to the next line, and the final progress display above should be preserved. However, the code forgot that depending on the length of the payload line, such a CR may fall exactly at the packet boundary and the number of bytes before the CR from the beginning of the packet could be zero. In such a case, the message that was terminated by the CR were leftover in the "scratch" buffer in the previous call to the function and we still need to clear to the end of the current line. Helped-by: Junio C Hamano <gitster@pobox.com> Helped-by: Nicolas Pitre <nico@fluxnic.net> Signed-off-by: Jiang Xin <zhiyou.jx@alibaba-inc.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'add-interactive.h')
0 files changed, 0 insertions, 0 deletions