diff options
author | 2012-07-10 11:39:52 +0000 | |
---|---|---|
committer | 2012-07-10 11:39:52 +0000 | |
commit | 6bcc35512726c4c7cda68cc2706f4346ab7c5da9 (patch) | |
tree | 6fadf3478a8166379284fc03c747b5ba0f00b6f0 | |
parent | nit (diff) | |
download | wireguard-openbsd-6bcc35512726c4c7cda68cc2706f4346ab7c5da9.tar.xz wireguard-openbsd-6bcc35512726c4c7cda68cc2706f4346ab7c5da9.zip |
pass the option string along as a 4th parameter, in cases canonical is
not all that matters (e.g., -fpie and friends)
-rw-r--r-- | usr.bin/libtool/LT/Getopt.pm | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/usr.bin/libtool/LT/Getopt.pm b/usr.bin/libtool/LT/Getopt.pm index 62565707965..6c4b07fe0c7 100644 --- a/usr.bin/libtool/LT/Getopt.pm +++ b/usr.bin/libtool/LT/Getopt.pm @@ -1,4 +1,4 @@ -# $OpenBSD: Getopt.pm,v 1.9 2012/07/09 21:59:18 espie Exp $ +# $OpenBSD: Getopt.pm,v 1.10 2012/07/10 11:39:52 espie Exp $ # Copyright (c) 2012 Marc Espie <espie@openbsd.org> # @@ -55,12 +55,12 @@ sub match { my ($self, $_, $opts, $canonical, $code) = @_; if (m/^\-\Q$$self\E$/) { - &$code($opts, $canonical, 1); + &$code($opts, $canonical, 1, $_); return 1; } - if (m/^\-\Q$$self\E(.*)$/) { - unshift(@main::ARGV, "-$1"); - &$code($opts, $canonical, 1); + if (m/^(\-\Q$$self\E)(.*)$/) { + unshift(@main::ARGV, "-$2"); + &$code($opts, $canonical, 1, $1); return 1; } return 0; @@ -73,11 +73,11 @@ sub match { my ($self, $_, $opts, $canonical, $code) = @_; if (m/^\-\Q$$self\E$/) { - &$code($opts, $canonical, (shift @main::ARGV)); + &$code($opts, $canonical, (shift @main::ARGV), $_); return 1; } - if (m/^\-\Q$$self\E(.*)$/) { - &$code($opts, $canonical, $1); + if (m/^(\-\Q$$self\E)(.*)$/) { + &$code($opts, $canonical, $2, $1); return 1; } return 0; @@ -90,7 +90,7 @@ sub match { my ($self, $_, $opts, $canonical, $code) = @_; if (m/^\-\Q$$self\E$/) { - &$code($opts, $canonical, 1); + &$code($opts, $canonical, 1, $_); return 1; } return 0; @@ -103,7 +103,7 @@ sub match my ($self, $_, $opts, $canonical, $code) = @_; if (m/^\-\Q$$self\E$/) { if (@main::ARGV > 0) { - &$code($opts, $canonical, (shift @main::ARGV)); + &$code($opts, $canonical, (shift @main::ARGV), $_); return 1; } else { die "Missing argument for option -$$self\n"; @@ -121,8 +121,8 @@ sub match if ($self->SUPER::match($_, $opts, $canonical, $code)) { return 1; } - if (m/^-\Q$$self\E\=(.*)$/) { - &$code($opts, $canonical, $1); + if (m/^(-\Q$$self\E)\=(.*)$/) { + &$code($opts, $canonical, $2, $1); return 1; } return 0; |