expr applet bug?

Cristian Ionescu-Idbohrn cristian.ionescu-idbohrn at axis.com
Fri Dec 8 19:47:34 UTC 2006


On Fri, 8 Dec 2006, Luciano Miguel Ferreira Rocha wrote:

> On Fri, Dec 08, 2006 at 08:13:35PM +0100, Cristian Ionescu-Idbohrn wrote:
> > There seems to be a bug in expr (both 1.1.3 and svn):
> >
> >   # ./busybox expr xyz0 : '[^0-9]\+\([0-9]\+\)'
> >
> > returns 0 on stdout and an error code 1.
> >
> >   # ./busybox expr xyz1 : '[^0-9]\+\([0-9]\+\)'
> >
> > returns 1 on stdout and an error code 0.
> >
>
> I get the same behaviour from GNU's expr.

Isn't that a bug too? Does bb need to imitate bugs too?

> What behaviour did you expect?

Obviously success in both cases mentioned above (from both GNU and bb
expr). I do expect an error on:

  # ./busybox expr 0xyz0 : '[^0-9]\+\([0-9]\+\)'

but not on:

  # ./busybox expr xyz0 : '[^0-9]\+\([0-9]\+\)'


Cheers,
Cristian



More information about the busybox mailing list