Edward,

But the runConfigure has something like this:
   # Get the command line parameters
   if test -x /usr/bin/getopt; then
   set -- `getopt p:c:x:dm:n:t:r:l:z:h $*`
   else
   set -- `getopts p:c:x:dm:n:t:r:l:z:h `$*``
   fi
   if [ $? != 0 ]
     then
     usage
     exit ${ERROR_EXIT_CODE}
   fi

the "getopt" should be able to catch any invalid argument.  I tested it and
get the following without running into loop:

 > runConfigure -xCC -ud
getopt: Not a recognized flag: u
runConfigure: Helper script to run "configure" for one of the supported
platforms
Usage: runConfigure "options"
       where options may be any of the following:
       -p <platform> (accepts 'aix', 'unixware', 'linux', 'solaris',
'hp-10', 'hp-11', 'os400', 'irix', 'ptx', 'tru64', 'macosx')
       -c <C compiler name> (e.g. gcc, xlc or icc)
       -x <C++ compiler name> (e.g. g++, xlC, or icc)
       -d (specifies that you want to build debug version)
       -h (get help on the above commands)
       -z <extra compiler options>

May be the system utility "getopt" behaves differently on different
platform??

Tinny


Edward Avis wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> One of the runConfigure.sh scripts in 1.5.2 will sit in an infinite loop
> if given an argument it doesn't understand.  This patch fixes it:
>
> - --- samples/runConfigure.orig Thu Nov 29 18:56:09 2001
> +++ samples/runConfigure        Thu Nov 29 19:05:01 2001
> @@ -146,6 +146,11 @@
>
>     --)
>          shift; break;;
> +
> +   *)
> +       echo "unknown option $1"
> +       usage
> +        exit ${ERROR_EXIT_CODE};;
>     esac
>  done
>
> Actually, it would be a good idea to change code looking like
>
> while [ $# -gt 0 ]
>     do
>     case $1 in
>        foo) something; shift;;
>        bar) something_else; shift 2;;
>     esac
> done
>
> to look instead like
>
> while [ $# -gt 0 ]
>     do
>     first_arg=$1
>     shift
>     case $first_arg in
>         foo) something;;
>         bar) something_else; shift;;
>     esac
> done
>
> That way, you get at least one 'shift' every time through the loop, so
> there's no chance of it looping forever if you forget to put shift in
> one of the cases (or if you leave out the default case).
>
> Anyway, I hope this utterly trivial patch makes a change from the
> tortuous and complicated XML handling you guys must deal with all day
> long :-).
>
> - --
> Ed Avis <[EMAIL PROTECTED]>
> Finger for PGP key
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.0.6 (GNU/Linux)
> Comment: For info see http://www.gnupg.org
>
> iD8DBQE8DMKQIMp73jhGogoRAvjFAJ97OlbxQzWQZyzuks58oe++ikqJpgCbBogo
> 0cFr+PU6OfWZwKDM1bIQ3uc=
> =zlxr
> -----END PGP SIGNATURE-----
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to