Skip to content
Snippets Groups Projects

cvsclient: handle files which lack a trailing newline

Compare changes
  • Side-by-side
  • Inline
Files
1
  • CVS uses \n as a protocol message separator, which forces us
    to read protocol message line-by-line. File content sent by
    the server has a length known and is transmitted in bytes.
    The server appends a final "ok\n" message (or perhaps an error
    message) when it is done sending file contents.
    
    Properly handle the case where this final message gets buffered
    along with file contents and is not delimited from file contents
    by \n because the file lacks a trailing newline. Previously, the
    final protocol message ended up being written out to file contents
    in this case.
    
    Found while testing ingestion of the GNU dino CVS repository from
    cvs.savannah.gnu.org/sources/dino.
Loading