From: Ralf Wildenhues Date: Wed, 4 Aug 2010 20:30:01 +0000 (+0200) Subject: Avoid syntax error due to shift of nonexistent parameter. X-Git-Tag: v2.4~100 X-Git-Url: http://git.ipfire.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=10f650c428d16805132088510b04a853c73b98fa;p=thirdparty%2Flibtool.git Avoid syntax error due to shift of nonexistent parameter. * libltdl/config/ltmain.m4sh : 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 --- diff --git a/ChangeLog b/ChangeLog index 49efb7b74..6c7f86d4c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,11 @@ 2010-08-04 Ralf Wildenhues + Avoid syntax error due to shift of nonexistent parameter. + * libltdl/config/ltmain.m4sh : 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 193ff1a4c..98c0a27e3 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"