From owner-freebsd-bugs Wed Jun 26 19:30:05 1996 Return-Path: owner-bugs Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id TAA13830 for bugs-outgoing; Wed, 26 Jun 1996 19:30:05 -0700 (PDT) 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 TAA13789; Wed, 26 Jun 1996 19:29:56 -0700 (PDT) Received: (from bostic@localhost) by mongoose.bostic.com (8.7.4/8.7.3) id WAA14135; Wed, 26 Jun 1996 22:21:17 -0400 (EDT) Date: Wed, 26 Jun 1996 22:21:17 -0400 (EDT) From: Keith Bostic Message-Id: <199606270221.WAA14135@mongoose.bostic.com> To: mark@linus.demon.co.uk Subject: Re: New bug introduced with sed bugfix Cc: freebsd-bugs@freefall.freebsd.org, FreeBSD-gnats-submit@FreeBSD.org, gnats@freefall.freebsd.org, mckusick@McKusick.COM, plm@xs4all.nl, torek@bsdi.com Sender: owner-bugs@FreeBSD.org X-Loop: FreeBSD.org Precedence: bulk Here's the current patch that BSD/OS is using. We've reviewed it and tested it on all of the bug reports that we had. Sure hope it works, --keith =================================================================== RCS file: /master/usr.bin/sed/compile.c,v retrieving revision 2.3 retrieving revision 2.5 diff -c -r2.3 -r2.5 *** compile.c 1996/06/03 21:25:33 2.3 --- compile.c 1996/06/27 01:11:13 2.5 *************** *** 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.5 1996/06/27 01:11:13 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,618 ---- op = s = text + size; p = lbuf; EATSPACE(); ! for (esc_nl = 0; *p != '\0'; p++) { ! if (*p == '\\' && *++p == '\n') ! esc_nl = 1; *s++ = *p; } size += s - op; ! if (!esc_nl) { *s = '\0'; break; }