From bostic@mongoose.bostic.com  Wed Jun 26 15:10:12 1996
Received: from mongoose.bostic.com (bostic@mongoose.BSDI.COM [205.230.230.129])
          by freefall.freebsd.org (8.7.5/8.7.3) with ESMTP id PAA21756
          for <FreeBSD-gnats-submit@freebsd.org>; Wed, 26 Jun 1996 15:10:10 -0700 (PDT)
Received: (from bostic@localhost) by mongoose.bostic.com (8.7.4/8.7.3) id SAA11327; Wed, 26 Jun 1996 18:01:16 -0400 (EDT)
Message-Id: <199606262201.SAA11327@mongoose.bostic.com>
Date: Wed, 26 Jun 1996 18:01:16 -0400 (EDT)
From: Keith Bostic <bostic@bsdi.com>
To: mark@linus.demon.co.uk
Cc: freebsd-bugs@freefall.freebsd.org, FreeBSD-gnats-submit@freebsd.org,
        gnats@freefall.freebsd.org, mckusick@McKusick.COM, plm@xs4all.nl
Subject: Re: New bug introduced with sed bugfix

>Number:         1353
>Category:       bin
>Synopsis:       Re: New bug introduced with sed bugfix
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    gnats-admin
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Jun 26 15:20:02 PDT 1996
>Closed-Date:    Wed Jul 3 15:57:18 PDT 1996
>Last-Modified:  Tue Nov 27 19:22:19 PST 2001
>Originator:     
>Release:        
>Organization:
>Environment:
>Description:
>How-To-Repeat:
>Fix:
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: mpp 
State-Changed-When: Wed Jul 3 15:57:18 PDT 1996 
State-Changed-Why:  
Bogus PR. 
>Unformatted:
 >> Remove revision 1.5 from compile.c
 >> This was supposed to fix a bug in dealing with continuation lines
 >> but somehow introduced this bug.
 >  
 >  My old patch attached to the (now closed) PR bin/908 fixes the original
 >  problem without introducing the new one.
 
 We discovered that the change wasn't right when we were reviewing
 my change internally -- I apologize for not forwarding a message
 when we found it!
 
 Here's the change that we ended up making.  I won't swear that
 it's right, but it hasn't broken yet.  ;-}
 
 --keith
 
 ===================================================================
 RCS file: /master/usr.bin/sed/compile.c,v
 retrieving revision 2.3
 retrieving revision 2.4
 diff -c -r2.3 -r2.4
 *** compile.c	1996/06/03 21:25:33	2.3
 --- compile.c	1996/06/26 22:03:21	2.4
 ***************
 *** 1,4 ****
 ! /*	BSDI $Id: compile.c,v 2.3 1996/06/03 21:25:33 bostic Exp $	*/
   
   /*-
    * Copyright (c) 1992 Diomidis Spinellis.
 --- 1,4 ----
 ! /*	BSDI $Id: compile.c,v 2.4 1996/06/26 22:03:21 bostic Exp $	*/
   
   /*-
    * Copyright (c) 1992 Diomidis Spinellis.
 ***************
 *** 595,601 ****
   static char *
   compile_text()
   {
 ! 	int asize, size;
   	char *text, *p, *op, *s;
   	char lbuf[_POSIX2_LINE_MAX + 1];
   
 --- 595,601 ----
   static char *
   compile_text()
   {
 ! 	int asize, esc_nl, size;
   	char *text, *p, *op, *s;
   	char lbuf[_POSIX2_LINE_MAX + 1];
   
 ***************
 *** 606,618 ****
   		op = s = text + size;
   		p = lbuf;
   		EATSPACE();
 ! 		for (; *p; p++) {
 ! 			if (*p == '\\')
 ! 				p++;
   			*s++ = *p;
   		}
   		size += s - op;
 ! 		if (p[-2] != '\\') {
   			*s = '\0';
   			break;
   		}
 --- 606,620 ----
   		op = s = text + size;
   		p = lbuf;
   		EATSPACE();
 ! 		for (esc_nl = 0; *p != '\0'; p++) {
 ! 			if (*p == '\\' && *++p == '\0') {
 ! 				esc_nl = 1;
 ! 				break;
 ! 			}
   			*s++ = *p;
   		}
   		size += s - op;
 ! 		if (!esc_nl) {
   			*s = '\0';
   			break;
   		}
 
