diff options
author | Niall O'Higgins <niallo@cvs.openbsd.org> | 2007-01-11 17:44:19 +0000 |
---|---|---|
committer | Niall O'Higgins <niallo@cvs.openbsd.org> | 2007-01-11 17:44:19 +0000 |
commit | d85c0dc058186c85cfed44b898af95f7d7ec453d (patch) | |
tree | a7da1e2066182857b36823351e715a72d4a32795 /usr.bin/cvs/annotate.c | |
parent | 97a8f0e03dbb1ac15c84940d8f111ff4fedfe002 (diff) |
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@
Diffstat (limited to 'usr.bin/cvs/annotate.c')
-rw-r--r-- | usr.bin/cvs/annotate.c | 6 |
1 files changed, 4 insertions, 2 deletions
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 <xsa@openbsd.org> * @@ -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); |