From d85c0dc058186c85cfed44b898af95f7d7ec453d Mon Sep 17 00:00:00 2001 From: Niall O'Higgins Date: Thu, 11 Jan 2007 17:44:19 +0000 Subject: rework opencvs so that we can deal with binary files. previously we assumed all files were ascii, which broke things in real-world usage. now a checkout of src should work, albeit using lots of memory and cpu. fixing this is the next step. testing by many. ok & some input joris@ --- usr.bin/cvs/annotate.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'usr.bin/cvs/annotate.c') diff --git a/usr.bin/cvs/annotate.c b/usr.bin/cvs/annotate.c index 5e26f7a425f..50a2440fca4 100644 --- a/usr.bin/cvs/annotate.c +++ b/usr.bin/cvs/annotate.c @@ -1,4 +1,4 @@ -/* $OpenBSD: annotate.c,v 1.33 2007/01/11 02:35:55 joris Exp $ */ +/* $OpenBSD: annotate.c,v 1.34 2007/01/11 17:44:18 niallo Exp $ */ /* * Copyright (c) 2006 Xavier Santolaria * @@ -112,6 +112,7 @@ cvs_annotate_local(struct cvs_file *cf) BUF *b; RCSNUM *ann_rev; char *content; + size_t len; ann_rev = NULL; @@ -136,8 +137,9 @@ cvs_annotate_local(struct cvs_file *cf) b = rcs_getrev(cf->file_rcs, ann_rev); cvs_buf_putc(b, '\0'); + len = cvs_buf_len(b); content = cvs_buf_release(b); - if ((lines = cvs_splitlines(content)) == NULL) + if ((lines = cvs_splitlines(content, len)) == NULL) fatal("cvs_annotate_local: cvs_splitlines failed"); xfree(content); -- cgit v1.2.3