summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--doio.c2
-rw-r--r--dump.c5
-rw-r--r--mro.c3
-rw-r--r--op.c13
4 files changed, 13 insertions, 10 deletions
diff --git a/doio.c b/doio.c
index 65adf910d5..8d7c812767 100644
--- a/doio.c
+++ b/doio.c
@@ -1439,7 +1439,7 @@ Perl_do_exec3(pTHX_ const char *incmd, int fd, int do_report)
const Size_t cmdlen = strlen(incmd) + 1;
Newx(buf, cmdlen, char);
cmd = buf;
- my_strlcpy(cmd, incmd, cmdlen);
+ memcpy(cmd, incmd, cmdlen);
while (*cmd && isSPACE(*cmd))
cmd++;
diff --git a/dump.c b/dump.c
index aa1228b9a7..2a3439aca8 100644
--- a/dump.c
+++ b/dump.c
@@ -2451,10 +2451,9 @@ Perl_do_pmop_xmldump(pTHX_ I32 level, PerlIO *file, const PMOP *pm)
Perl_xmldump_indent(aTHX_ level, file, "<pmop \n");
level++;
if (PM_GETRE(pm)) {
- const char * const s = PM_GETRE(pm)->precomp;
- SV * const tmpsv = newSVpvn("",0);
+ const regexp *const r = PM_GETRE(pm);
+ SV * const tmpsv = newSVpvn(r->precomp,r->prelen);
SvUTF8_on(tmpsv);
- sv_catxmlpvn(tmpsv, s, strlen(s), 1);
Perl_xmldump_indent(aTHX_ level, file, "pre=\"%s\"\n",
SvPVX(tmpsv));
SvREFCNT_dec(tmpsv);
diff --git a/mro.c b/mro.c
index 37a0e96f33..87c102e34d 100644
--- a/mro.c
+++ b/mro.c
@@ -840,8 +840,7 @@ XS(XS_mro_is_universal)
classname = ST(0);
- classname_pv = SvPV_nolen(classname);
- classname_len = strlen(classname_pv);
+ classname_pv = SvPV(classname,classname_len);
he = hv_fetch_ent(PL_isarev, classname, 0, 0);
isarev = he ? (HV*)HeVAL(he) : NULL;
diff --git a/op.c b/op.c
index 15510b27c4..3b40d3ee1d 100644
--- a/op.c
+++ b/op.c
@@ -7218,6 +7218,8 @@ Perl_ck_require(pTHX_ OP *o)
SV * const sv = kid->op_sv;
U32 was_readonly = SvREADONLY(sv);
char *s;
+ STRLEN len;
+ const char *end;
if (was_readonly) {
if (SvFAKE(sv)) {
@@ -7229,14 +7231,17 @@ Perl_ck_require(pTHX_ OP *o)
}
}
- for (s = SvPVX(sv); *s; s++) {
+ s = SvPVX(sv);
+ len = SvCUR(sv);
+ end = s + len;
+ for (; s < end; s++) {
if (*s == ':' && s[1] == ':') {
- const STRLEN len = strlen(s+2)+1;
*s = '/';
- Move(s+2, s+1, len, char);
- SvCUR_set(sv, SvCUR(sv) - 1);
+ Move(s+2, s+1, end - s, char);
+ --end;
}
}
+ SvEND_set(sv, end);
sv_catpvs(sv, ".pm");
SvFLAGS(sv) |= was_readonly;
}