diff options
author | Jarkko Hietaniemi <jhi@iki.fi> | 2001-11-01 13:59:42 +0000 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2001-11-01 13:59:42 +0000 |
commit | 6ec9efeca46af8ccad8021f3fbd9ab7f1721da05 (patch) | |
tree | f7b8d60eba013caff02a97835ab671895d8e5007 /pp_ctl.c | |
parent | 23ada85b460be8277660729bedb0954a8b123cf2 (diff) | |
download | perl-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.c | 14 |
1 files changed, 13 insertions, 1 deletions
@@ -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) |