summaryrefslogtreecommitdiff
path: root/sv.c
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2013-08-10 05:30:41 -0700
committerFather Chrysostomos <sprout@cpan.org>2013-08-11 07:54:25 -0700
commit85b7d9b3f528e54538bc898015eba6bd0460c2d2 (patch)
tree54340283ffab1c2845648695b86a7be43d7227f2 /sv.c
parent48120f8fb3801512144143e22a9f264d9ceab915 (diff)
downloadperl-85b7d9b3f528e54538bc898015eba6bd0460c2d2.tar.gz
Fix booleanness of regexps
I broke this when I stopped regexps from being POK in 5.18.
Diffstat (limited to 'sv.c')
-rw-r--r--sv.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/sv.c b/sv.c
index 198ae73bbe..ec8026122d 100644
--- a/sv.c
+++ b/sv.c
@@ -3155,6 +3155,9 @@ Perl_sv_2bool_flags(pTHX_ SV *const sv, const I32 flags)
}
return SvRV(sv) != 0;
}
+ if (isREGEXP(sv))
+ return
+ RX_WRAPLEN(sv) > 1 || (RX_WRAPLEN(sv) && *RX_WRAPPED(sv) != '0');
return SvTRUE_common(sv, isGV_with_GP(sv) ? 1 : 0);
}