diff options
author | Marc Espie <espie@cvs.openbsd.org> | 2012-07-10 11:39:53 +0000 |
---|---|---|
committer | Marc Espie <espie@cvs.openbsd.org> | 2012-07-10 11:39:53 +0000 |
commit | 0ac20a8dd708335279255c571898c4ea4f1f240e (patch) | |
tree | 12ba5427df5ffbb7683e4264560b00b9ecb5eb7f /usr.bin/libtool | |
parent | 845ba79298bd84e25f2e0d9ecb4c952fee76955c (diff) |
pass the option string along as a 4th parameter, in cases canonical is
not all that matters (e.g., -fpie and friends)
Diffstat (limited to 'usr.bin/libtool')
-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; |