Subject: Re: textproc/nbsed broken on non-NetBSD systems
To: Alan Barrett <apb@cequrux.com>
From: David Laight <david@l8s.co.uk>
List: tech-pkg
Date: 05/01/2005 10:14:01
On Fri, Apr 29, 2005 at 08:02:20PM +0200, Alan Barrett wrote:
> On Fri, 29 Apr 2005, Robert Lillack wrote:
> > Can anybody confirm that nbsed has a somewhat bad behaviour on systems 
> > other than NetBSD when called like this:
> > 
> > 	nbsed 's/a/b/' -x
> > 
> > IMHO '-x' has to be be interpreted as filename _always_, but nbsed is 
> > (why?) inconsistent across different operating systems.
> 
> nbsed just used getopt() in a way that works fine on NetBSD.  But GNU
> getopt likes to interpret "-x" as an option even when it appears after
> non-option args.

When I found that, I wondered just where such broken behaviour originated!

> I suggest one or more of the following fixes or workarounds:

5) Add an explicit -- after the options,
	nbsed -- 's/a/b/' -x

	David

-- 
David Laight: david@l8s.co.uk