Bug 26153

Summary: sed G does not double space
Product: Base System Reporter: mjanosi
Component: miscAssignee: Juli Mallett <jmallett>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: Unspecified   
Hardware: Any   
OS: Any   

Description mjanosi 2001-03-27 19:50:01 UTC
sed G should double space a file and it does not.

How-To-Repeat: # The following command and result
% (echo a; echo b; echo c) | sed G
a
b
c
%

# should be
% (echo a ; echo b ; echo c) | sed G
a

b

c

%
Comment 1 ashp freebsd_committer freebsd_triage 2002-02-09 02:09:47 UTC
State Changed
From-To: open->feedback

Can you try the following patch (stolen from NetBSD) and see if it helps 
you at all?  Seems to work here. 

--- process.c.orig      Fri Feb  8 20:56:37 2002 
+++ process.c   Fri Feb  8 21:06:06 2002 
@@ -149,6 +149,8 @@ 
cspace(&PS, hs, hsl, REPLACE); 
break; 
case 'G': 
+                               if (hs == NULL) 
+                                   cspace(&HS, "n", 1, REPLACE); 
cspace(&PS, hs, hsl, 0); 
break; 
case 'h':
Comment 2 Juli Mallett freebsd_committer freebsd_triage 2002-04-02 07:27:39 UTC
Responsible Changed
From-To: freebsd-bugs->jmallett

Over to me.
Comment 3 Juli Mallett freebsd_committer freebsd_triage 2002-04-05 06:40:52 UTC
State Changed
From-To: feedback->patched

Committed fix suggested by ashp to HEAD, awaiting MFC.
Comment 4 Juli Mallett freebsd_committer freebsd_triage 2002-04-09 08:49:55 UTC
State Changed
From-To: patched->closed

MFC'd, thanks!