Subject: bin/28126: sed fails to match empty back-reference
To: None <>
From: Andrew Brown <>
List: netbsd-bugs
Date: 11/08/2004 21:36:10
>Number:         28126
>Category:       bin
>Synopsis:       sed fails to match empty back-reference
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Nov 09 02:37:00 UTC 2004
>Originator:     TheMan
>Release:        2.99.10
System: NetBSD this 2.99.10 NetBSD 2.99.10 (THAT) #346: Mon Nov  8 07:58:51 EST 2004  andrew@this:/usr/src/sys/arch/i386/compile/THAT i386


	sed fails to match an empty back-reference.  i discovered this
after i partially zorched my cvs tree and my Root and Repository files
mostly ended up containing garbage.  finding improper Repository files
should have been as simple as:

	% cd /usr/src
	% find ./bin -path \*/CVS/Repository | \
		xargs grep -H . | \
		sed -n '/^\.\(.*\)\/CVS\/Repository:src\1$/d;p'

yet the first line out is 


which is clearly fine.


on netbsd current

	% echo foobar | sed -ne '/foo\(.*\)bar\1/p'
	% echo foo1bar1 | sed -ne '/foo\(.*\)bar\1/p'

compared to solaris:

	% echo foobar | sed -ne '/foo\(.*\)bar\1/p'


	% echo foobar | sed -ne '/foo\(.*\)bar\1/p'

netbsd 2.0_RC4:

	% echo foobar | sed -ne '/foo\(.*\)bar\1/p'

netbsd 1.6ZL:

	% echo foobar | sed -ne '/foo\(.*\)bar\1/p'



not sure.  repeatedly updating my sed tree to something older (and
older and older) didn't yield any good results, so i suppose it might
be a recent change to regex stuff in libc?