This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Lots of consting
[perl5.git] / pp_ctl.c
index 8fd89c0..a0333e6 100644 (file)
--- a/pp_ctl.c
+++ b/pp_ctl.c
@@ -3054,9 +3054,9 @@ PP(pp_require)
     dVAR; dSP;
     register PERL_CONTEXT *cx;
     SV *sv;
-    char *name;
+    const char *name;
     STRLEN len;
-    char *tryname = Nullch;
+    const char *tryname = Nullch;
     SV *namesv = Nullsv;
     SV** svp;
     const I32 gimme = GIMME_V;
@@ -3084,7 +3084,7 @@ PP(pp_require)
 
            RETPUSHYES;
     }
-    name = SvPV(sv, len);
+    name = SvPV_const(sv, len);
     if (!(name && len > 0 && *name))
        DIE(aTHX_ "Null filename used");
     TAINT_PROPER("require");
@@ -3296,7 +3296,7 @@ PP(pp_require)
     SvREFCNT_dec(namesv);
     if (!tryrsfp) {
        if (PL_op->op_type == OP_REQUIRE) {
-           char *msgstr = name;
+           const char *msgstr = name;
            if (namesv) {                       /* did we lookup @INC? */
                SV *msg = sv_2mortal(newSVpv(msgstr,0));
                SV *dirmsgsv = NEWSV(0, 0);
@@ -3406,7 +3406,7 @@ PP(pp_entereval)
     CV* runcv;
     U32 seq;
 
-    if (!SvPV(sv,len))
+    if (!SvPV_const(sv,len))
        RETPUSHUNDEF;
     TAINT_PROPER("eval");