summaryrefslogtreecommitdiff
path: root/regcomp.c
diff options
context:
space:
mode:
authorKarl Williamson <khw@cpan.org>2014-05-07 17:36:40 -0600
committerKarl Williamson <khw@cpan.org>2014-05-31 10:02:23 -0600
commit80836a6e6831e963c975485a02ff412288031439 (patch)
tree64b35e8d1cacd6d8d8a1e14badada216214a714e /regcomp.c
parent1b556768ed70af7d74162f5be819208687c0690f (diff)
downloadperl-80836a6e6831e963c975485a02ff412288031439.tar.gz
PATCH: [perl #121777] User-defined prop and packages
The solution to this is to add the package name to the property name for run-time lookup. Thanks for Darin McBride for finding an inefficiency in an earlier version of this patch.
Diffstat (limited to 'regcomp.c')
-rw-r--r--regcomp.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/regcomp.c b/regcomp.c
index 7f51feaad9..9ca959fd32 100644
--- a/regcomp.c
+++ b/regcomp.c
@@ -13619,6 +13619,19 @@ parseit:
"Property '%"UTF8f"' is unknown",
UTF8fARG(UTF, n, name));
}
+
+ /* If the property name doesn't already have a package
+ * name, add the current one to it so that it can be
+ * referred to outside it. [perl #121777] */
+ if (! instr(name, "::") && PL_curstash) {
+ char* full_name = Perl_form(aTHX_
+ "%s::%s",
+ HvNAME(PL_curstash),
+ name);
+ n = strlen(full_name);
+ Safefree(name);
+ name = savepvn(full_name, n);
+ }
Perl_sv_catpvf(aTHX_ listsv, "%cutf8::%"UTF8f"\n",
(value == 'p' ? '+' : '!'),
UTF8fARG(UTF, n, name));