summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>1999-06-06 15:42:25 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>1999-06-06 15:42:25 +0000
commit3e29d370d34e36521af551ecdf668776ce05b07e (patch)
tree3ef0142c3177700e1c46167c618bc2c79ac68281
parent84d2f7cbaac661c274aa9037852c09b5de050974 (diff)
make G newline if hold is empty
-rw-r--r--usr.bin/sed/process.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/usr.bin/sed/process.c b/usr.bin/sed/process.c
index 7741fe288cb..8988b48acf6 100644
--- a/usr.bin/sed/process.c
+++ b/usr.bin/sed/process.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: process.c,v 1.4 1998/04/30 06:21:16 deraadt Exp $ */
+/* $OpenBSD: process.c,v 1.5 1999/06/06 15:42:24 deraadt Exp $ */
/*-
* Copyright (c) 1992 Diomidis Spinellis.
@@ -39,7 +39,7 @@
#ifndef lint
/* from: static char sccsid[] = "@(#)process.c 8.1 (Berkeley) 6/6/93"; */
-static char *rcsid = "$OpenBSD: process.c,v 1.4 1998/04/30 06:21:16 deraadt Exp $";
+static char *rcsid = "$OpenBSD: process.c,v 1.5 1999/06/06 15:42:24 deraadt Exp $";
#endif /* not lint */
#include <sys/types.h>
@@ -146,6 +146,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':