summaryrefslogtreecommitdiff
path: root/pp_ctl.c
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>2001-11-01 13:59:42 +0000
committerJarkko Hietaniemi <jhi@iki.fi>2001-11-01 13:59:42 +0000
commit6ec9efeca46af8ccad8021f3fbd9ab7f1721da05 (patch)
treef7b8d60eba013caff02a97835ab671895d8e5007 /pp_ctl.c
parent23ada85b460be8277660729bedb0954a8b123cf2 (diff)
downloadperl-6ec9efeca46af8ccad8021f3fbd9ab7f1721da05.tar.gz
If an encoding is set by -M/-m, it must be in
effect only for the actual script, not any other required/-M/-m'ed module, otherwise we enter a nasty recursion in regexec.c while trying to init the simple UTF-8 charclasses like PL_utf8_alnum. p4raw-id: //depot/perl@12799
Diffstat (limited to 'pp_ctl.c')
-rw-r--r--pp_ctl.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/pp_ctl.c b/pp_ctl.c
index 567370be8b..9e73ca2b71 100644
--- a/pp_ctl.c
+++ b/pp_ctl.c
@@ -3036,6 +3036,8 @@ PP(pp_require)
SV *filter_state = 0;
SV *filter_sub = 0;
SV *hook_sv = 0;
+ SV *encoding;
+ OP *op;
sv = POPs;
if (SvNIOKp(sv)) {
@@ -3379,7 +3381,17 @@ trylocal: {
PL_eval_owner = thr;
MUTEX_UNLOCK(&PL_eval_mutex);
#endif /* USE_5005THREADS */
- return DOCATCH(doeval(gimme, NULL));
+
+ /* Store and reset encoding. */
+ encoding = PL_encoding;
+ PL_encoding = Nullsv;
+
+ op = DOCATCH(doeval(gimme, NULL));
+
+ /* Restore encoding. */
+ PL_encoding = encoding;
+
+ return op;
}
PP(pp_dofile)