From owner-freebsd-bugs Fri Jun 14 14:42:14 2002 Delivered-To: freebsd-bugs@hub.freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id 354B937B414 for ; Fri, 14 Jun 2002 14:41:02 -0700 (PDT) Received: (from gnats@localhost) by freefall.freebsd.org (8.11.6/8.11.6) id g5ELe1H65030; Fri, 14 Jun 2002 14:40:01 -0700 (PDT) (envelope-from gnats) Received: from h132-197-179-27.gte.com (h132-197-179-27.gte.com [132.197.179.27]) by hub.freebsd.org (Postfix) with ESMTP id 10E3F37B438; Fri, 14 Jun 2002 14:34:17 -0700 (PDT) Received: from kanpc.gte.com (localhost [IPv6:::1]) by h132-197-179-27.gte.com (8.12.3/8.12.3) with ESMTP id g5ELUlAW087208; Fri, 14 Jun 2002 17:30:49 -0400 (EDT) (envelope-from ak03@kanpc.gte.com) Received: (from ak03@localhost) by kanpc.gte.com (8.12.4/8.12.4/Submit) id g5ELUkQm087207; Fri, 14 Jun 2002 17:30:46 -0400 (EDT) Message-Id: <200206142130.g5ELUkQm087207@kanpc.gte.com> Date: Fri, 14 Jun 2002 17:30:46 -0400 (EDT) From: Alexander Kabaev Reply-To: Alexander Kabaev To: FreeBSD-gnats-submit@FreeBSD.org Cc: sobomax@FreeBSD.org, tjr@FreeBSD.org X-Send-Pr-Version: 3.113 Subject: bin/39310: sed was broken in rev. 1.22 of main.c Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org >Number: 39310 >Category: bin >Synopsis: sed was broken in rev. 1.22 of main.c >Confidential: no >Severity: critical >Priority: high >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Fri Jun 14 14:40:01 PDT 2002 >Closed-Date: >Last-Modified: >Originator: Alexander Kabaev >Release: FreeBSD 5.0-CURRENT i386 >Organization: >Environment: System: FreeBSD kanpc.gte.com 5.0-CURRENT FreeBSD 5.0-CURRENT #0: Thu Jun 13 12:38:33 EDT 2002 root@kanpc.gte.com:/usr/obj/usr/src/sys/KANPC i386 >Description: The revision 1.22 commit resulted in sed 'N' function to broke. The N function tries to append data to the space and call mf_fgets to fetch the next line. mf_fgets function resets the space length to 0 for no reason, thus causing the previous content of the space to be overwritten instead of being appended to. >How-To-Repeat: The following sed script from the teTex port does not work as expected, causing the port build to fail: : again /\.$/{ N s/\.\n/\ ./ t again } >Fix: Index: main.c =================================================================== RCS file: /usr/ncvs/src/usr.bin/sed/main.c,v retrieving revision 1.23 diff -u -r1.23 main.c --- main.c 14 Jun 2002 02:20:05 -0000 1.23 +++ main.c 14 Jun 2002 21:20:48 -0000 @@ -315,7 +315,6 @@ firstfile = 1; } - sp->len = 0; for (;;) { if (f != NULL && (c = getc(f)) != EOF) { (void)ungetc(c, f); >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message