Re: wierd busybox bugs on find
On Mon, Nov 29, 1999 at 06:18:06PM -0700, Erik Andersen wrote:
> On Sat Nov 27, 1999 at 01:11:05AM -0500, Adam Di Carlo wrote:
> > Problems with 'find'. These examples are from the rescue filesystem,
> > CVS build from today:
> > # cd /usr/bin
> > # find . -name '*log'
> > * or \+ or \? follows nothingSegmentation fault
> > -- note that 'find . -name "*log"' is perfectly valid.
> > # find . -name 'log*'
> > ./loadfont
> > ./logger
> > -- looks like an "off by one" error -- it's matching 'lo*' ?
> status report:
> I had an hour today to start digging into this one (between meetings and
> writing of product design docs -- ugh), anyways, it is a real bugger.
> Seems that you've uncovered a case where the regexp parser is indeed
> doing an off-by-one. I see where the problem lies, and I'm working on
> finding the right fix that won't break anything else. Expect a fix Real
> Soon Now(tm), but probably not tonight since my wife wants us to go and
> buy some sort of a coniferous christmas shrub ;-).
I have no clue about anything boot-floppies related, but, at first glance,
it looks to me like the busybox find is using regexps in the -name pattern.
This would give the behaviour described in both cases (except for the
segfault :-)), and seems to be implied by Erik's reply... but, from the
Base of file name (the path with the leading direc-
tories removed) matches shell pattern pattern.
So -name should be using globbing, not regexps. Maybe this is the real
cause of confusion?