From owner-freebsd-bugs Thu Aug 16 18:30:11 2001 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 D29D737B410 for ; Thu, 16 Aug 2001 18:30:06 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.11.4/8.11.4) id f7H1U6A18953; Thu, 16 Aug 2001 18:30:06 -0700 (PDT) (envelope-from gnats) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id 9789E37B406 for ; Thu, 16 Aug 2001 18:27:18 -0700 (PDT) (envelope-from nobody@FreeBSD.org) Received: (from nobody@localhost) by freefall.freebsd.org (8.11.4/8.11.4) id f7H1RIA18748; Thu, 16 Aug 2001 18:27:18 -0700 (PDT) (envelope-from nobody) Message-Id: <200108170127.f7H1RIA18748@freefall.freebsd.org> Date: Thu, 16 Aug 2001 18:27:18 -0700 (PDT) From: Jeremy Chadwick To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-1.0 Subject: bin/29790: sed "G" command broken 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: 29790 >Category: bin >Synopsis: sed "G" command broken >Confidential: no >Severity: serious >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Thu Aug 16 18:30:06 PDT 2001 >Closed-Date: >Last-Modified: >Originator: Jeremy Chadwick >Release: 4.4-RC, and 2.2.8 >Organization: >Environment: FreeBSD pentarou.parodius.com 4.4-RC FreeBSD 4.4-RC #1: Wed Aug 15 23:35:36 PDT 2001 root@pentarou.parodius.com:/usr/obj/usr/src/sys/PARODIUS-SMP i386 >Description: The "G" command in sed does not conform to proper sed usage; command does not output a newline as stated in the manpage, nor as stated in the official sed FAQ. This applies to ALL versions of FreeBSD (tested/verified on 2.2.8 and all 4.x revisions). This bug more than likely applies to OpenBSD and NetBSD as well. I'm hoping this bug can get squashed before 4.4-STABLE comes out... >How-To-Repeat: $ printf "1\n2\n3\n" | sed '1,2H;2G' The output is: 1 2 1 2 3 But should be: 1 2 (blank line) 1 2 3 >Fix: Approximately line 151 of src/usr.bin/sed/process.c: cspace(&PS, hs, hsl, 0); Change to: cspace(&PS, "\n", 1, 0); cspace(&PS, hs, hsl, 0); >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message