cvs: pear /Console_Getargs Getargs.php

From: Date: Thu, 07 Apr 2005 06:55:52 +0000
Subject: cvs: pear /Console_Getargs Getargs.php
Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-31006@lists.php.net to get a copy of this message
wenz Thu Apr 7 02:55:52 2005 EDT Modified files: /pear/Console_Getargs Getargs.php Log: fixing bug #4090 (reported by schst, thanks!) http://cvs.php.net/diff.php/pear/Console_Getargs/Getargs.php?r1=1.15&r2=1.16&ty=u Index: pear/Console_Getargs/Getargs.php diff -u pear/Console_Getargs/Getargs.php:1.15 pear/Console_Getargs/Getargs.php:1.16 --- pear/Console_Getargs/Getargs.php:1.15 Wed Nov 17 16:32:52 2004 +++ pear/Console_Getargs/Getargs.php Thu Apr 7 02:55:51 2005 @@ -16,7 +16,7 @@ // | Author: Bertrand Mansion <bmansion@mamasam.com> | // +----------------------------------------------------------------------+ // -// $Id: Getargs.php,v 1.15 2004/11/17 21:32:52 scottmattocks Exp $ +// $Id: Getargs.php,v 1.16 2005/04/07 06:55:51 wenz Exp $ require_once 'PEAR.php'; @@ -943,7 +943,10 @@ foreach ($this->_config as $longname => $def) { // Add the default value only if the default is defined // and the option requires at least one argument. - if (isset($def['default']) && $def['min'] !== 0 && !isset($this->_longLong[$longname])) { + if (isset($def['default']) && + ((isset($def['min']) && $def['min'] !== 0) || + (!isset($def['min']) & isset($def['max']) && $def['max'] !== 0)) && + !isset($this->_longLong[$longname])) { $this->_longLong[$longname] = $def['default']; } }

« previous php.pear.cvs (#31006) next »