From marcus@shumai.marcuscom.com  Sat Jun 15 23:44:07 2002
Return-Path: <marcus@shumai.marcuscom.com>
Received: from shumai.marcuscom.com (rdu57-17-158.nc.rr.com [66.57.17.158])
	by hub.freebsd.org (Postfix) with ESMTP id 83DF637B40A
	for <FreeBSD-gnats-submit@freebsd.org>; Sat, 15 Jun 2002 23:44:06 -0700 (PDT)
Received: from shumai.marcuscom.com (marcus@localhost.marcuscom.com [127.0.0.1])
	by shumai.marcuscom.com (8.12.3/8.12.3) with ESMTP id g5G6iNgl095779
	for <FreeBSD-gnats-submit@freebsd.org>; Sun, 16 Jun 2002 02:44:23 -0400 (EDT)
	(envelope-from marcus@shumai.marcuscom.com)
Received: (from marcus@localhost)
	by shumai.marcuscom.com (8.12.3/8.12.3/Submit) id g5G6iNva095778;
	Sun, 16 Jun 2002 02:44:23 -0400 (EDT)
Message-Id: <200206160644.g5G6iNva095778@shumai.marcuscom.com>
Date: Sun, 16 Jun 2002 02:44:23 -0400 (EDT)
From: Joe Marcus Clarke <marcus@freebsd.org>
Reply-To: Joe Marcus Clarke <marcus@freebsd.org>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: [PATCH] sed is broken in -CURRENT
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         39358
>Category:       bin
>Synopsis:       [PATCH] sed is broken in -CURRENT
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    sobomax
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat Jun 15 23:50:02 PDT 2002
>Closed-Date:    Sun Jun 16 00:04:41 PDT 2002
>Last-Modified:  Sun Jun 16 00:04:41 PDT 2002
>Originator:     Joe Marcus Clarke
>Release:        FreeBSD 4.6-RC i386
>Organization:
MarcusCom, Inc.
>Environment:
FreeBSD jclarke-pc.cisco.com 5.0-CURRENT FreeBSD 5.0-CURRENT #0: Fri Jun 14 16:13:19 EDT 2002     marcus@jclarke-pc.cisco.com:/usr/obj/usr/src/sys/JCLARKE-PC  i386

>Description:
After the recent -i fixes, sed no longer works in all instances.  Many ports
no longer make configure correctly (they hang indefinitely).  The problem
is that sp->len is being unnecessarily overwritten in mf_fgets().  The 
attached patch fixes the problem.
>How-To-Repeat:
# cd /usr/ports/net/gaim
# make configure
>Fix:

--- usr.bin/sed/main.c	2002/06/14 02:20:05	1.23
+++ usr.bin/sed/main.c	2002/06/16 04:38:31
@@ -315,7 +315,8 @@
 		firstfile = 1;
 	}
 
-	sp->len = 0;
+	if (lastline)
+		sp->len = 0;
 	for (;;) {
 		if (f != NULL && (c = getc(f)) != EOF) {
 			(void)ungetc(c, f);
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->sobomax 
Responsible-Changed-By: marcus 
Responsible-Changed-When: Sat Jun 15 23:52:32 PDT 2002 
Responsible-Changed-Why:  
Assign to sobomax since he was the one to commit the offending patch. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=39358 
State-Changed-From-To: open->closed 
State-Changed-By: marcus 
State-Changed-When: Sun Jun 16 00:04:27 PDT 2002 
State-Changed-Why:  
Dup of 39310 

http://www.freebsd.org/cgi/query-pr.cgi?pr=39358 
>Unformatted:
