]> git.ipfire.org Git - thirdparty/libtool.git/commitdiff
ltmain.in: Fix infinite loop for error messages
authorIleana Dumitrescu <ileanadumitrescu95@gmail.com>
Thu, 14 Nov 2024 19:05:12 +0000 (21:05 +0200)
committerIleana Dumitrescu <ileanadumitrescu95@gmail.com>
Wed, 20 Nov 2024 15:36:29 +0000 (17:36 +0200)
If an invalid argument is passed to options '--mode' or '--reorder-cache'
after a valid command, error messages will print infinitely:

  $ libtool --help --mode=MODE
  libtool:   error: invalid argument 'MODE' for --mode
  libtool:   error: invalid argument 'MODE' for --mode
  libtool:   error: invalid argument 'MODE' for --mode
  ...

* build-aux/ltmain.in: Remove 'break' in case statement to fix infinite
  loop, and add shift for option '--reorder-cache' to allow more options
  to be processed.

build-aux/ltmain.in

index 9d891127f3d8659664947c2c46d7d1ac74e05072..4d7fc293d3fba04c0d4f8d0e0ad8771bfcdf713e 100644 (file)
@@ -474,7 +474,6 @@ libtool_parse_options ()
                           # Catch anything else as an error
                           *) func_error "invalid argument '$1' for $_G_opt"
                              exit_cmd=exit
-                             break
                              ;;
                         esac
                         shift
@@ -512,10 +511,10 @@ libtool_parse_options ()
                             *) func_error "invalid argument '$1' for $_G_opt"
                                func_error "absolute paths are required for $_G_opt"
                                exit_cmd=exit
-                               break
                                ;;
                           esac
                         fi
+                        shift
                         ;;
 
         --silent|--quiet)