diff options
Diffstat (limited to 'lib/getopts.pl')
-rw-r--r-- | lib/getopts.pl | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/getopts.pl b/lib/getopts.pl index 4ed3a053f9..6590918016 100644 --- a/lib/getopts.pl +++ b/lib/getopts.pl @@ -6,11 +6,12 @@ sub Getopts { local($argumentative) = @_; - local(@args,$_,$first,$rest,$errs); + local(@args,$_,$first,$rest); + local($errs) = 0; local($[) = 0; @args = split( / */, $argumentative ); - while(($_ = $ARGV[0]) =~ /^-(.)(.*)/) { + while(@ARGV && ($_ = $ARGV[0]) =~ /^-(.)(.*)/) { ($first,$rest) = ($1,$2); $pos = index($argumentative,$first); if($pos >= $[) { |