author | Carlos Martín Nieto <cmn@elego.de> | |
Mon, 28 Nov 2011 10:48:12 +0000 (11:48 +0100) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Mon, 28 Nov 2011 19:30:34 +0000 (11:30 -0800) | ||
commit | 284e3d280ea84957f5bedcb302848dbdcdbb9a62 | |
tree | e3db1809b4cbb311a7a1cec79023e0b6aa68adfa | tree | snapshot |
parent | 703f05ad5835cff92b12c29aecf8d724c8c847e2 | commit | diff |
convert: track state in LF-to-CRLF filter
There may not be enough space to store CRLF in the output. If we don't
fill the buffer, then the filter will keep getting called with the same
short buffer and will loop forever.
Instead, always store the CR and record whether there's a missing LF
if so we store it in the output buffer the next time the function gets
called.
Reported-by: Henrik Grubbström <grubba@roxen.com>
Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
There may not be enough space to store CRLF in the output. If we don't
fill the buffer, then the filter will keep getting called with the same
short buffer and will loop forever.
Instead, always store the CR and record whether there's a missing LF
if so we store it in the output buffer the next time the function gets
called.
Reported-by: Henrik Grubbström <grubba@roxen.com>
Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
convert.c | diff | blob | history |