convert: track state in LF-to-CRLF filter
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 <8c05419cf750eecebb57eee18827b7594fe78c97@roxen.com>
Signed-off-by: Carlos Martín Nieto <eecb638c0e60875b4a70118790d5be43bb59c2d6@elego.de>
Signed-off-by: Junio C Hamano <a6723cc3f76163bf7adb636a73ac3b0ceb3e6b9b@pobox.com>

destenson/git,destenson/git,destenson/git,destenson/git,destenson/git,destenson/git,destenson/git,destenson/git