Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 27 Mar 2002 12:06:55 -0800 (PST)
From:      John Fitzgibbon <fitz@jfitz.com>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   bin/36383: sed misbehaves with 2044 char substitute patterns
Message-ID:  <200203272006.g2RK6te22171@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200203272006.g2RK6te22171>