summaryrefslogtreecommitdiffstats
path: root/usr.bin/rcs/rcsutil.c
diff options
context:
space:
mode:
authorniallo <niallo@openbsd.org>2006-09-22 05:38:29 +0000
committerniallo <niallo@openbsd.org>2006-09-22 05:38:29 +0000
commit2e4454c008fb68fa8e3830e5ce84bb4507b8c822 (patch)
tree90b5448521574a371cf7955df20c92a1accdaa91 /usr.bin/rcs/rcsutil.c
parentput a few printf's in the interrupt handler under VR_DEBUG. (diff)
downloadwireguard-openbsd-2e4454c008fb68fa8e3830e5ce84bb4507b8c822.tar.xz
wireguard-openbsd-2e4454c008fb68fa8e3830e5ce84bb4507b8c822.zip
- handle deltatexts which don't end in a newline character. fixes PR #5241.
ok ray@
Diffstat (limited to 'usr.bin/rcs/rcsutil.c')
-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);