summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorNiall O'Higgins <niallo@cvs.openbsd.org>2006-09-22 05:38:30 +0000
committerNiall O'Higgins <niallo@cvs.openbsd.org>2006-09-22 05:38:30 +0000
commit7d6a7408c5cf9cd40d22001c03e226d34e8494b8 (patch)
treebc7e2e3a5a76a05be93f1a93a4a3e0d63008e515 /usr.bin
parent400c6fe5b7421a234a70c9ed3b490c7bdb9b6312 (diff)
- handle deltatexts which don't end in a newline character. fixes PR #5241.
ok ray@
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/rcs/rcsutil.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/usr.bin/rcs/rcsutil.c b/usr.bin/rcs/rcsutil.c
index 43a594f1562..db019a01d59 100644
--- a/usr.bin/rcs/rcsutil.c
+++ b/usr.bin/rcs/rcsutil.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rcsutil.c,v 1.19 2006/09/19 05:52:23 otto Exp $ */
+/* $OpenBSD: rcsutil.c,v 1.20 2006/09/22 05:38:29 niallo Exp $ */
/*
* Copyright (c) 2005, 2006 Joris Vink <joris@openbsd.org>
* Copyright (c) 2006 Xavier Santolaria <xsa@openbsd.org>
@@ -492,7 +492,8 @@ rcs_splitlines(BUF *fcont)
p = c = lines->l_data;
for (i = 0; i < rcs_buf_len(fcont); i++) {
- if (*p == '\n') {
+ if (*p == '\n' || (i == rcs_buf_len(fcont) - 1 && *c)) {
+ printf("c: %x\n", *c);
len = p - c;
lp = xmalloc(sizeof(*lp));
lp->l_line = xmalloc(len + 1);