summaryrefslogtreecommitdiff
path: root/regcomp.c
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>2003-03-16 15:20:38 +0000
committerJarkko Hietaniemi <jhi@iki.fi>2003-03-16 15:20:38 +0000
commitec2e9529541857fd49fd25e82781509c0e6b345e (patch)
treef972b2dff2d476296bd0cc64af17ae71f913c3df /regcomp.c
parent3ffeae58a4a6ed8a86b911d67efed107f9a4a77b (diff)
downloadperl-ec2e9529541857fd49fd25e82781509c0e6b345e.tar.gz
Integrate:
[ 18984] Subject: [patch ext/B/typemap] STRLEN T_UV From: Stas Bekman <stas@stason.org> Date: Fri, 14 Mar 2003 17:45:09 +1100 Message-ID: <3E717A75.2060300@stason.org> [ 18985] Time::HiRes is a core module [ 18986] Subject: Re: [fix] [perl #21575] Bug with print( followed by a newline From: Enache Adrian <enache@rdslink.ro> Date: Fri, 14 Mar 2003 23:02:42 +0200 Message-ID: <20030314210242.GA1159@ratsnest.hole> (with an added test) [ 18988] Needs PerlIO for :bytes. [ 18989] Make the :bytes conditional on PerlIO. [ 18990] Further potential pitfalls for the utf8 len/pos cache found by Inaba Hiroto. No test cases, yet. [ 18991] Pod fix from Philip Newton. [ 18992] Better wording from Philip Newton. p4raw-link: @18992 on //depot/maint-5.8/perl: 3ffeae58a4a6ed8a86b911d67efed107f9a4a77b p4raw-link: @18991 on //depot/perl: 8e2ffcbee9e186d24888a8a811664acb9d44c042 p4raw-link: @18990 on //depot/perl: 0eda9292bc85e7f943d7a8738310d47e93f67325 p4raw-link: @18989 on //depot/perl: 17ba578bf41cdb4933f7c577f6b4ba5403154874 p4raw-link: @18988 on //depot/perl: 21d92c23f49d139d8bddefbab6f984eb17e12d43 p4raw-link: @18986 on //depot/perl: 4a202259b5c58b8852cda4ec492b88e9baff32c6 p4raw-link: @18985 on //depot/perl: c5f9c75a0ab10c124cfd9ab014b49dfd4ad68196 p4raw-link: @18984 on //depot/perl: fee282c331ea1a47aa2de971fa0e3bda5f4a0cfe p4raw-id: //depot/maint-5.8/perl@18993 p4raw-integrated: from //depot/perl@18992 'copy in' ext/B/typemap (@4484..) t/comp/parser.t (@18753..) ext/Encode/t/CJKT.t (@18970..) 'merge in' toke.c (@18865..) regcomp.c (@18904..) pod/perlfunc.pod (@18908..)
Diffstat (limited to 'regcomp.c')
-rw-r--r--regcomp.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/regcomp.c b/regcomp.c
index 8f103b659e..8c9dfa843f 100644
--- a/regcomp.c
+++ b/regcomp.c
@@ -495,6 +495,13 @@ S_scan_commit(pTHX_ RExC_state_t *pRExC_state, scan_data_t *data)
}
}
SvCUR_set(data->last_found, 0);
+ {
+ SV * sv = data->last_found;
+ MAGIC *mg =
+ SvUTF8(sv) && SvMAGICAL(sv) ? mg_find(sv, PERL_MAGIC_utf8) : NULL;
+ if (mg && mg->mg_len > 0)
+ mg->mg_len = 0;
+ }
data->last_end = -1;
data->flags &= ~SF_BEFORE_EOL;
}
@@ -913,6 +920,14 @@ S_study_chunk(pTHX_ RExC_state_t *pRExC_state, regnode **scanp, I32 *deltap, reg
? I32_MAX : data->pos_min + data->pos_delta;
}
sv_catpvn(data->last_found, STRING(scan), STR_LEN(scan));
+ {
+ SV * sv = data->last_found;
+ MAGIC *mg = SvUTF8(sv) && SvMAGICAL(sv) ?
+ mg_find(sv, PERL_MAGIC_utf8) : NULL;
+ if (mg && mg->mg_len >= 0)
+ mg->mg_len += utf8_length(STRING(scan),
+ STRING(scan)+STR_LEN(scan));
+ }
if (UTF)
SvUTF8_on(data->last_found);
data->last_end = data->pos_min + l;
@@ -1283,6 +1298,14 @@ S_study_chunk(pTHX_ RExC_state_t *pRExC_state, regnode **scanp, I32 *deltap, reg
SvCUR_set(data->last_found,
SvCUR(data->last_found) - l);
sv_catsv(data->last_found, last_str);
+ {
+ SV * sv = data->last_found;
+ MAGIC *mg =
+ SvUTF8(sv) && SvMAGICAL(sv) ?
+ mg_find(sv, PERL_MAGIC_utf8) : NULL;
+ if (mg && mg->mg_len >= 0)
+ mg->mg_len += CHR_SVLEN(last_str);
+ }
data->last_end += l * (mincount - 1);
}
} else {