From e80338a799cccbbb67de94c25fc54abbce278716 Mon Sep 17 00:00:00 2001 From: Joris Vink Date: Wed, 9 Jan 2019 17:57:06 +0000 Subject: When expanding $Log$ make sure a newline is added if rd_log has none. This can happen on new RCS files. Fixes $Log$ keyword expansion. --- usr.bin/rcs/rcs.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'usr.bin/rcs') diff --git a/usr.bin/rcs/rcs.c b/usr.bin/rcs/rcs.c index f4aca8cd97c..30415b9de17 100644 --- a/usr.bin/rcs/rcs.c +++ b/usr.bin/rcs/rcs.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rcs.c,v 1.87 2019/01/09 17:55:28 joris Exp $ */ +/* $OpenBSD: rcs.c,v 1.88 2019/01/09 17:57:05 joris Exp $ */ /* * Copyright (c) 2004 Jean-Francois Brousseau * All rights reserved. @@ -1672,6 +1672,10 @@ rcs_expand_keywords(char *rcsfile_in, struct rcs_delta *rdp, BUF *bp, int mode) ++j; buf_append(newbuf, rdp->rd_log + i, j); } + + if (i > 0 && rdp->rd_log[i - 1] != '\n') + buf_putc(newbuf, '\n'); + buf_append(newbuf, line, line2 - line); for (j = 0; c + j < fin; ++j) { if (c[j] != ' ') -- cgit v1.2.3