]> git.ipfire.org Git - thirdparty/libtool.git/commitdiff
Avoid syntax error due to shift of nonexistent parameter.
authorRalf Wildenhues <Ralf.Wildenhues@gmx.de>
Wed, 4 Aug 2010 20:30:01 +0000 (22:30 +0200)
committerRalf Wildenhues <Ralf.Wildenhues@gmx.de>
Wed, 4 Aug 2010 20:30:14 +0000 (22:30 +0200)
* 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>
ChangeLog
libltdl/config/ltmain.m4sh

index 49efb7b74aefbda89d8ee26bdcbd4f1ec7a80354..6c7f86d4c1b9b14bef6ae75eff83d5ac2d8123a8 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -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
index 193ff1a4c0da379db4d6e45defb17279677fb4fb..98c0a27e3103eb556685dfb28345d8e7c58bfe33 100644 (file)
@@ -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"