From owner-freebsd-current Sun Jun 16 1:55: 0 2002 Delivered-To: freebsd-current@freebsd.org Received: from dilbert.robbins.dropbear.id.au (214.b.009.mel.iprimus.net.au [210.50.113.214]) by hub.freebsd.org (Postfix) with ESMTP id F204F37B403 for ; Sun, 16 Jun 2002 01:54:54 -0700 (PDT) Received: from dilbert.robbins.dropbear.id.au (tim@localhost [127.0.0.1]) by dilbert.robbins.dropbear.id.au (8.12.3/8.12.3) with ESMTP id g5G8soY2025519 for ; Sun, 16 Jun 2002 18:54:51 +1000 (EST) (envelope-from tim@dilbert.robbins.dropbear.id.au) Received: (from tim@localhost) by dilbert.robbins.dropbear.id.au (8.12.3/8.12.3/Submit) id g5G8rZPH025518 for current@FreeBSD.ORG; Sun, 16 Jun 2002 18:53:35 +1000 (EST) Date: Sun, 16 Jun 2002 18:53:35 +1000 From: Tim Robbins To: current@FreeBSD.ORG Subject: [tjr@FreeBSD.org: cvs commit: src/usr.bin/sed main.c] Message-ID: <20020616185335.A25500@dilbert.robbins.dropbear.id.au> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Does this fix the recent problems people were having with sed? The examples I could dig up on the web that use the `N' command work properly with this change (same as they do on -DP1). Here are a few of the examples that are fixed: (from http://www.faqs.org/faqs/editor-faq/sed/) # 10. Delete all CONSECUTIVE blank lines from file except the first. # This method also deletes all blank lines from top and end of file. # (emulates "cat -s") sed '/./,/^$/!d' file # this allows 0 blanks at top, 1 at EOF sed '/^$/N;/\n$/D' file # this allows 1 blank at top, 0 at EOF # 12. Delete all trailing blank lines at end of file (only). sed -e :a -e '/^\n*$/{$d;N;};/\n$/ba' file # 13. If a line ends with a backslash, join the next line to it. sed -e :a -e '/\\$/N; s/\\\n//; ta' file If this change doesn't fix the problems, please give me small and simple sed scripts that demonstrate the incorrect behaviour. Tim ----- Forwarded message from "Tim J. Robbins" ----- Delivered-To: tjr@freebsd.org Delivered-To: cvs-committers@freebsd.org From: "Tim J. Robbins" Date: Sun, 16 Jun 2002 01:44:39 -0700 (PDT) To: cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: cvs commit: src/usr.bin/sed main.c X-FreeBSD-CVS-Branch: HEAD Precedence: bulk X-Loop: FreeBSD.ORG tjr 2002/06/16 01:44:39 PDT Modified files: usr.bin/sed main.c Log: Correct the handling of (for example) the N command by only zeroing the input space in mf_fgets() if we reach the end of all input files. Revision Changes Path 1.24 +2 -1 src/usr.bin/sed/main.c ----- End forwarded message ----- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message