In perl.git, the branch blead has been updated <http://perl5.git.perl.org/perl.git/commitdiff/05ddb96b05e4ece1cff932941be35a369d3fd1bf?hp=005700e9b03137beeab81285c93bdf3b797bb055>
- Log ----------------------------------------------------------------- commit 05ddb96b05e4ece1cff932941be35a369d3fd1bf Author: Father Chrysostomos <[email protected]> Date: Fri Jul 1 21:59:00 2011 -0700 Add another address for John Peacock M Porting/checkAUTHORS.pl commit c8c8e589d797908c16fc78c20698c3b606331e15 Author: John Peacock <[email protected]> Date: Fri Jul 1 23:18:09 2011 -0400 Revise check for negative versions plus test M lib/version.pm M lib/version.t M util.c ----------------------------------------------------------------------- Summary of changes: Porting/checkAUTHORS.pl | 1 + lib/version.pm | 2 +- lib/version.t | 4 ++++ util.c | 8 +++++--- 4 files changed, 11 insertions(+), 4 deletions(-) diff --git a/Porting/checkAUTHORS.pl b/Porting/checkAUTHORS.pl index 266bee3..ada5fff 100755 --- a/Porting/checkAUTHORS.pl +++ b/Porting/checkAUTHORS.pl @@ -639,6 +639,7 @@ jpeacock\100rowman.com john.peacock\100havurah-software.org + jpeacock\100havurah-software.org + jpeacock\100dsl092-147-156.wdc1.dsl.speakeasy.net + jpeacock\100jpeacock-hp.doesntexist.org ++ jpeacock\100cpan.org jql\100accessone.com jql\100jql.accessone.com jsm28\100hermes.cam.ac.uk jsm28\100cam.ac.uk diff --git a/lib/version.pm b/lib/version.pm index adeaacd..1126f91 100644 --- a/lib/version.pm +++ b/lib/version.pm @@ -6,7 +6,7 @@ use strict; use vars qw(@ISA $VERSION $CLASS $STRICT $LAX *declare *qv); -$VERSION = 0.88; +$VERSION = 0.92; $CLASS = 'version'; diff --git a/lib/version.t b/lib/version.t index d2e3a2b..bee9078 100644 --- a/lib/version.t +++ b/lib/version.t @@ -213,6 +213,10 @@ sub BaseTests { like($@, qr/non-numeric data/, "Invalid version format (non-numeric data)"); + eval { $version = $CLASS->$method("-1.23")}; + like($@, qr/negative version number/, + "Invalid version format (negative version number)"); + # from here on out capture the warning and test independently { eval{$version = $CLASS->$method("99 and 44/100 pure")}; diff --git a/util.c b/util.c index fcfeda9..e22a97f 100644 --- a/util.c +++ b/util.c @@ -4541,6 +4541,11 @@ dotted_decimal_version: } } + /* and we never support negative versions */ + if ( *d == '-') { + BADVERSION(s,errstr,"Invalid version format (negative version number)"); + } + /* consume all of the integer part */ while (isDIGIT(*d)) d++; @@ -4559,9 +4564,6 @@ dotted_decimal_version: /* found just an integer */ goto version_prescan_finish; } - else if ( *d == '-') { - BADVERSION(s,errstr,"Invalid version format (negative version number)"); - } else if ( d == s ) { /* didn't find either integer or period */ BADVERSION(s,errstr,"Invalid version format (non-numeric data)"); -- Perl5 Master Repository
