From: Akim Demaille Date: Tue, 19 Sep 2000 12:35:01 +0000 (+0000) Subject: * autoconf.sh (optarg): More robust expr invocation. X-Git-Tag: autoconf-2.50~625 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=66dcecdf2fe5fed422a5e20c9dadc707b66172eb;p=thirdparty%2Fautoconf.git * autoconf.sh (optarg): More robust expr invocation. * autoreconf.sh: Likewise. * autoupdate.sh: Likewise. * autoheader.sh: Likewise. Reported by Bernard Dautrevaux. --- diff --git a/ChangeLog b/ChangeLog index 125e3d6df..e0c79138c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2000-09-19 Akim Demaille + + * autoconf.sh (optarg): More robust expr invocation. + * autoreconf.sh: Likewise. + * autoupdate.sh: Likewise. + * autoheader.sh: Likewise. + Reported by Bernard Dautrevaux. + 2000-09-19 Pavel Roskin * acgeneral.m4 (AU_ALIAS): Do not use `defn' since then autoupdate diff --git a/autoconf.in b/autoconf.in index ae79c6a2c..cd9b1bec7 100644 --- a/autoconf.in +++ b/autoconf.in @@ -125,8 +125,8 @@ verbose=: # Parse command line. while test $# -gt 0 ; do - optarg=`expr "$1" : '--[^=]*=\(.*\)' \| \ - "$1" : '-.\(.*\)'` + optarg=`expr "x$1" : 'x--[^=]*=\(.*\)' \| \ + "x$1" : 'x-.\(.*\)'` case $1 in --version | --vers* | -V ) echo "$version" ; exit 0 ;; diff --git a/autoconf.sh b/autoconf.sh index ae79c6a2c..cd9b1bec7 100644 --- a/autoconf.sh +++ b/autoconf.sh @@ -125,8 +125,8 @@ verbose=: # Parse command line. while test $# -gt 0 ; do - optarg=`expr "$1" : '--[^=]*=\(.*\)' \| \ - "$1" : '-.\(.*\)'` + optarg=`expr "x$1" : 'x--[^=]*=\(.*\)' \| \ + "x$1" : 'x-.\(.*\)'` case $1 in --version | --vers* | -V ) echo "$version" ; exit 0 ;; diff --git a/autoheader.in b/autoheader.in index 1773dc71e..1b09befdb 100644 --- a/autoheader.in +++ b/autoheader.in @@ -96,8 +96,8 @@ warning_obsolete=false # Parse command line. while test $# -gt 0 ; do - optarg=`expr "$1" : '--[^=]*=\(.*\)' \| \ - "$1" : '-.\(.*\)'` + optarg=`expr "x$1" : 'x--[^=]*=\(.*\)' \| \ + "x$1" : 'x-.\(.*\)'` case $1 in --version | --vers* | -V ) echo "$version" ; exit 0 ;; diff --git a/autoheader.sh b/autoheader.sh index 1773dc71e..1b09befdb 100644 --- a/autoheader.sh +++ b/autoheader.sh @@ -96,8 +96,8 @@ warning_obsolete=false # Parse command line. while test $# -gt 0 ; do - optarg=`expr "$1" : '--[^=]*=\(.*\)' \| \ - "$1" : '-.\(.*\)'` + optarg=`expr "x$1" : 'x--[^=]*=\(.*\)' \| \ + "x$1" : 'x-.\(.*\)'` case $1 in --version | --vers* | -V ) echo "$version" ; exit 0 ;; diff --git a/autoreconf.in b/autoreconf.in index 46453c04b..95533b557 100644 --- a/autoreconf.in +++ b/autoreconf.in @@ -128,7 +128,8 @@ done # Parse command line. while test $# -gt 0; do - optarg=`expr "$1" : '-[^=]*=\(.*\)'` + optarg=`expr "x$1" : 'x--[^=]*=\(.*\)' \| \ + "x$1" : 'x-.\(.*\)'` case "$1" in --version | --vers* | -V ) echo "$version" ; exit 0 ;; @@ -150,23 +151,23 @@ while test $# -gt 0; do localdir=$1 shift ;; - --macrodir=* ) - autoconf_dir=$optarg - shift ;; --macrodir | -m ) test $# = 1 && eval "$exit_missing_arg" shift autoconf_dir=$1 shift ;; - - --m4dir=* ) - m4dir=$optarg + --macrodir=* | -m* ) + autoconf_dir=$optarg shift ;; + --m4dir | -M ) test $# = 1 && eval "$exit_missing_arg" shift m4dir=$1 shift ;; + --m4dir=* | -M* ) + m4dir=$optarg + shift ;; --force | -f ) force=:; shift ;; diff --git a/autoreconf.sh b/autoreconf.sh index 46453c04b..95533b557 100644 --- a/autoreconf.sh +++ b/autoreconf.sh @@ -128,7 +128,8 @@ done # Parse command line. while test $# -gt 0; do - optarg=`expr "$1" : '-[^=]*=\(.*\)'` + optarg=`expr "x$1" : 'x--[^=]*=\(.*\)' \| \ + "x$1" : 'x-.\(.*\)'` case "$1" in --version | --vers* | -V ) echo "$version" ; exit 0 ;; @@ -150,23 +151,23 @@ while test $# -gt 0; do localdir=$1 shift ;; - --macrodir=* ) - autoconf_dir=$optarg - shift ;; --macrodir | -m ) test $# = 1 && eval "$exit_missing_arg" shift autoconf_dir=$1 shift ;; - - --m4dir=* ) - m4dir=$optarg + --macrodir=* | -m* ) + autoconf_dir=$optarg shift ;; + --m4dir | -M ) test $# = 1 && eval "$exit_missing_arg" shift m4dir=$1 shift ;; + --m4dir=* | -M* ) + m4dir=$optarg + shift ;; --force | -f ) force=:; shift ;; diff --git a/bin/autoconf.in b/bin/autoconf.in index ae79c6a2c..cd9b1bec7 100644 --- a/bin/autoconf.in +++ b/bin/autoconf.in @@ -125,8 +125,8 @@ verbose=: # Parse command line. while test $# -gt 0 ; do - optarg=`expr "$1" : '--[^=]*=\(.*\)' \| \ - "$1" : '-.\(.*\)'` + optarg=`expr "x$1" : 'x--[^=]*=\(.*\)' \| \ + "x$1" : 'x-.\(.*\)'` case $1 in --version | --vers* | -V ) echo "$version" ; exit 0 ;; diff --git a/bin/autoheader.in b/bin/autoheader.in index 1773dc71e..1b09befdb 100644 --- a/bin/autoheader.in +++ b/bin/autoheader.in @@ -96,8 +96,8 @@ warning_obsolete=false # Parse command line. while test $# -gt 0 ; do - optarg=`expr "$1" : '--[^=]*=\(.*\)' \| \ - "$1" : '-.\(.*\)'` + optarg=`expr "x$1" : 'x--[^=]*=\(.*\)' \| \ + "x$1" : 'x-.\(.*\)'` case $1 in --version | --vers* | -V ) echo "$version" ; exit 0 ;; diff --git a/bin/autoreconf.in b/bin/autoreconf.in index 46453c04b..95533b557 100644 --- a/bin/autoreconf.in +++ b/bin/autoreconf.in @@ -128,7 +128,8 @@ done # Parse command line. while test $# -gt 0; do - optarg=`expr "$1" : '-[^=]*=\(.*\)'` + optarg=`expr "x$1" : 'x--[^=]*=\(.*\)' \| \ + "x$1" : 'x-.\(.*\)'` case "$1" in --version | --vers* | -V ) echo "$version" ; exit 0 ;; @@ -150,23 +151,23 @@ while test $# -gt 0; do localdir=$1 shift ;; - --macrodir=* ) - autoconf_dir=$optarg - shift ;; --macrodir | -m ) test $# = 1 && eval "$exit_missing_arg" shift autoconf_dir=$1 shift ;; - - --m4dir=* ) - m4dir=$optarg + --macrodir=* | -m* ) + autoconf_dir=$optarg shift ;; + --m4dir | -M ) test $# = 1 && eval "$exit_missing_arg" shift m4dir=$1 shift ;; + --m4dir=* | -M* ) + m4dir=$optarg + shift ;; --force | -f ) force=:; shift ;;