summaryrefslogtreecommitdiffstats
path: root/usr.bin/sed
diff options
context:
space:
mode:
authortjr <tjr@FreeBSD.org>2002-07-03 14:32:43 +0000
committertjr <tjr@FreeBSD.org>2002-07-03 14:32:43 +0000
commitf71af381af338a718b4808374ec0fa5be8193bc3 (patch)
treea97560334a0cbc99e0b09cb4b4b383736a8ca193 /usr.bin/sed
parenta451e34e3bdad6764f7122e783453f63ccae8e96 (diff)
downloadFreeBSD-src-f71af381af338a718b4808374ec0fa5be8193bc3.zip
FreeBSD-src-f71af381af338a718b4808374ec0fa5be8193bc3.tar.gz
Don't let the pattern space become null if the `x' command is used when the
hold space is null; some functions assume it's never null. MFC after: 3 days
Diffstat (limited to 'usr.bin/sed')
-rw-r--r--usr.bin/sed/process.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/usr.bin/sed/process.c b/usr.bin/sed/process.c
index 83031b1..b2cfbc7 100644
--- a/usr.bin/sed/process.c
+++ b/usr.bin/sed/process.c
@@ -237,6 +237,8 @@ redirect:
err(1, "%s", cp->t);
break;
case 'x':
+ if (hs == NULL)
+ cspace(&HS, "", 0, REPLACE);
tspace = PS;
PS = HS;
HS = tspace;
OpenPOWER on IntegriCloud