On Sep 13, 2000, Bernard Dautrevaux <[EMAIL PROTECTED]> wrote:

> $ echo `expr "-" : '-[^=]*=\(.*\)'`
> expr: syntax error

> However the patch sent correct this anyway :-)

Nope, `echo' is also subject to `-' problems.

The right fix is one of:

option=`expr "x$1" : 'x-[^=]=\(.*\)'`

or

option=`echo "x$1" | sed -e '1s/^x//' -e 's/^-[^=]*=//'`

The former is slightly better in handling of backslashes, but the
second wouldn't fail for command-line arguments that are too long,
when using implementations of `expr' that fail if the matched string
is longer 128 bytes or longer.

-- 
Alexandre Oliva   Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer                  aoliva@{cygnus.com, redhat.com}
CS PhD student at IC-Unicamp        oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist    *Please* write to mailing lists, not to me
_______________________________________________
autoconf mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/autoconf

Reply via email to