From owner-freebsd-bugs Wed Mar 27 12:10:11 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 646CC37B41A for ; Wed, 27 Mar 2002 12:10:01 -0800 (PST) Received: (from gnats@localhost) by freefall.freebsd.org (8.11.6/8.11.6) id g2RKA1H22599; Wed, 27 Mar 2002 12:10:01 -0800 (PST) (envelope-from gnats) Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id 8425837B41D for ; Wed, 27 Mar 2002 12:06:55 -0800 (PST) Received: (from nobody@localhost) by freefall.freebsd.org (8.11.6/8.11.6) id g2RK6te22171; Wed, 27 Mar 2002 12:06:55 -0800 (PST) (envelope-from nobody) Message-Id: <200203272006.g2RK6te22171@freefall.freebsd.org> Date: Wed, 27 Mar 2002 12:06:55 -0800 (PST) From: John Fitzgibbon To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-1.0 Subject: bin/36383: sed misbehaves with 2044 char substitute patterns 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: 36383 >Category: bin >Synopsis: sed misbehaves with 2044 char substitute patterns >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Wed Mar 27 12:10:01 PST 2002 >Closed-Date: >Last-Modified: >Originator: John Fitzgibbon >Release: 4.5-STABLE >Organization: >Environment: FreeBSD joy.jfitz.com 4.5-STABLE FreeBSD 4.5-STABLE #0: Thu Mar 7 11:17:05 PST 2002 fitz@joy.jfitz.com:/usr/obj/usr/src/sys/JOY i386 >Description: %sed `perl -e 'print "s/"; print "x" x 2044; print "//g"'` test.dat %sed `perl -e 'print "s/"; print "x" x 2043; print "/y/g"'` test.dat %sed `perl -e 'print "s/"; print "x" x 2042; print "/yy/g"'` test.dat The commands above all give no output, regardless of the input file. Any other total count of x's and y's in the substitute pattern will print the file test.dat without modification, (up to 2046, at which point sed appears to begin truncating the input): %sed `perl -e 'print "s/"; print "x" x 2046; print "//g"'` test.dat sed: 1: "s/xxxxxxxxxxxxxxxxxxxxx ...": unterminated substitute pattern It's a little strange that the pattern seems to work for 2045 characters, but not 2044 or 2046. >How-To-Repeat: >Fix: >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message