autoconf-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Tru64 expr limitation


From: Eric Blake
Subject: Re: Tru64 expr limitation
Date: Sat, 04 Mar 2006 17:21:34 -0700
User-agent: Thunderbird 1.5 (Windows/20051201)

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

According to Ralf Wildenhues on 3/4/2006 11:14 AM:
> Tru64 UNIX 5.1 expr is a bit borked, in that it converts the result of a
> regex match into a number if possible.  :-(
>   $ expr 00001 : '.*\(...\)'
>   1

Nice catch.

> 
> I'd guess you prefer the unified behavior but a bit slower everywhere
> instead, done in the patch below.  OK to apply?
>       * doc/autoconf.texi (Limitations of Usual Tools) <expr :>:
>       Mention Tru64 expr bug that turns the result of a regex match
>       into a number if possible.

This part looks great.

>       * lib/autotest/general.m4 (AT_INIT): Work around it using
>       `echo | sed'.

What about this, instead:

> @@ -935,7 +935,7 @@
>        for at_group in $at_fail_list
>        do
>          # Normalize the test group number and cat the log.
> -        at_group_normalized=`expr "00000$at_group" : ".*\($at_format\)"`
> +     at_group_normalized=`echo "00000$at_group" | sed 
> "s,.*\($at_format\),\1,"`
>          cat "$at_suite_dir/$at_group_normalized/$as_me.log"

Seeing as how we are only using at_group_normalized as a directory name,
would the following, faster approach work?  (I'm hesitant to introduce
extra forks when they can be avoided, having seen how slow it is on cygwin).

at_group_normalized=`expr "00000$at_group/" : ".*\($at_format/\)"`
cat "$at_suite_dir/$at_group_normalized$as_me.log"

- --
Life is short - so eat dessert first!

Eric Blake             address@hidden
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.1 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFECi8O84KuGfSFAYARAq83AJoDLbnLToaz+c7E+wTMJjpOyIUWggCeKUfg
GwkuDIkyNoC7wfjrwFPY0y8=
=PevA
-----END PGP SIGNATURE-----




reply via email to

[Prev in Thread] Current Thread [Next in Thread]