Fix bug pointed out by Jerry Peek <jpeek@jpeek.com> in PR bin/7674.

If hold space null when doing an 'G', make sure it contains a newline.
Fix copied from revision 1.17 where cgd applied a fix for 'x'.
This commit is contained in:
kim 1999-05-31 04:46:33 +00:00
parent d3df2008f1
commit fd771a9c66
1 changed files with 4 additions and 2 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: process.c,v 1.24 1998/12/19 22:12:32 christos Exp $ */
/* $NetBSD: process.c,v 1.25 1999/05/31 04:46:33 kim Exp $ */
/*-
* Copyright (c) 1992 Diomidis Spinellis.
@ -42,7 +42,7 @@
#if 0
static char sccsid[] = "@(#)process.c 8.6 (Berkeley) 4/20/94";
#else
__RCSID("$NetBSD: process.c,v 1.24 1998/12/19 22:12:32 christos Exp $");
__RCSID("$NetBSD: process.c,v 1.25 1999/05/31 04:46:33 kim Exp $");
#endif
#endif /* not lint */
@ -151,6 +151,8 @@ redirect:
cspace(&PS, hs, hsl, REPLACE);
break;
case 'G':
if (hs == NULL)
cspace(&HS, "\n", 1, REPLACE);
cspace(&PS, hs, hsl, 0);
break;
case 'h':