diff options
author | Ralf Wildenhues <Ralf.Wildenhues@gmx.de> | 2010-08-04 22:30:01 +0200 |
---|---|---|
committer | Ralf Wildenhues <Ralf.Wildenhues@gmx.de> | 2010-08-04 22:30:14 +0200 |
commit | 10f650c428d16805132088510b04a853c73b98fa (patch) | |
tree | 72ac35a7dade778ea84360d135875311eff8b463 | |
parent | 06543b43736a9d36c447e7fa04b76d90a6b31967 (diff) | |
download | libtool-10f650c428d16805132088510b04a853c73b98fa.tar.gz |
Avoid syntax error due to shift of nonexistent parameter.
* libltdl/config/ltmain.m4sh <command-line handling>: Only shift
if there is a positional parameter to shift. Fixes `libtool
--help' when dash is used.
Report by Rainer Tammer.
Signed-off-by: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | libltdl/config/ltmain.m4sh | 5 |
2 files changed, 10 insertions, 1 deletions
@@ -1,5 +1,11 @@ 2010-08-04 Ralf Wildenhues <Ralf.Wildenhues@gmx.de> + Avoid syntax error due to shift of nonexistent parameter. + * libltdl/config/ltmain.m4sh <command-line handling>: Only shift + if there is a positional parameter to shift. Fixes `libtool + --help' when dash is used. + Report by Rainer Tammer. + Fix testsuite errors due to shell quoted parameter expansion issue. * tests/getopt-m4sh.at (_LT_AT_GETOPT_M4SH_SETUP): Insert space between double-quoted and unquoted shell parameter, as bash diff --git a/libltdl/config/ltmain.m4sh b/libltdl/config/ltmain.m4sh index 193ff1a4..98c0a27e 100644 --- a/libltdl/config/ltmain.m4sh +++ b/libltdl/config/ltmain.m4sh @@ -387,7 +387,10 @@ M4SH_GETOPTS( func_enable_tag "$optarg"], [ # save first non-option argument - nonopt="$opt"; shift + if test "$[]#" -gt 0; then + nonopt="$opt" + shift + fi # preserve --debug $opt_debug && func_append preserve_args " --debug" |