diff options
author | Father Chrysostomos <sprout@cpan.org> | 2013-09-11 13:10:15 -0700 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2014-01-04 05:10:03 -0800 |
commit | 8a3edca7ce6c05c68923832e2f5e5eac46975fd0 (patch) | |
tree | cc7204d00defb633f7bb8ae4d70b0a9eeb1b0b83 | |
parent | e1c774b63b5d338bcd31ca90bfd101f387e4fb43 (diff) | |
download | perl-8a3edca7ce6c05c68923832e2f5e5eac46975fd0.tar.gz |
[rt.cpan.org #88495] bad string comparison in version->qv
qv is affected, too. A package called "ver" inheriting from version
should be able to create "ver" objects via ->qv.
-rw-r--r-- | cpan/version/t/coretests.pm | 1 | ||||
-rw-r--r-- | vxs.inc | 4 |
2 files changed, 3 insertions, 2 deletions
diff --git a/cpan/version/t/coretests.pm b/cpan/version/t/coretests.pm index 34b0181fc7..7ece45b424 100644 --- a/cpan/version/t/coretests.pm +++ b/cpan/version/t/coretests.pm @@ -579,6 +579,7 @@ SKIP: { { # https://rt.cpan.org/Ticket/Display.html?id=88495 @ver::ISA = "version"; is ref(ver->new), 'ver', 'ver can inherit from version'; + is ref(ver->qv("1.2.3")), 'ver', 'ver can inherit from version'; } } @@ -436,8 +436,8 @@ XS(XS_version_qv) } else { rv = sv_2mortal(new_version(ver)); } - if ( items == 2 - && strnNE(classname,"version", len) ) { /* inherited new() */ + if ( items == 2 && (len != 7 + || strnNE(classname,"version", len)) ) { /* inherited new() */ sv_bless(rv, gv_stashpvn(classname, len, GV_ADD | flags)); } PUSHs(rv); |