A few more places where we know the length for sv_setpv() or sv_catpv()
Nicholas Clark [Fri, 2 Feb 2007 22:10:39 +0000 (22:10 +0000)]
p4raw-id: //depot/perl@30101

mg.c
op.c
pp_ctl.c
toke.c

diff --git a/mg.c b/mg.c
index a3e0f26..ecd8ad5 100644 (file)
--- a/mg.c
+++ b/mg.c
@@ -1186,7 +1186,7 @@ Perl_magic_getsig(pTHX_ SV *sv, MAGIC *mg)
 #endif
            /* cache state so we don't fetch it again */
            if(sigstate == (Sighandler_t) SIG_IGN)
-               sv_setpv(sv,"IGNORE");
+               sv_setpvs(sv,"IGNORE");
            else
                sv_setsv(sv,&PL_sv_undef);
            PL_psig_ptr[i] = SvREFCNT_inc_simple_NN(sv);
diff --git a/op.c b/op.c
index bb2a32c..f46f543 100644 (file)
--- a/op.c
+++ b/op.c
@@ -4899,7 +4899,7 @@ Perl_cv_ckproto_len(pTHX_ const CV *cv, const GV *gv, const char *p,
 
        if (gv)
            gv_efullname3(name = sv_newmortal(), gv, NULL);
-       sv_setpv(msg, "Prototype mismatch:");
+       sv_setpvs(msg, "Prototype mismatch:");
        if (name)
            Perl_sv_catpvf(aTHX_ msg, " sub %"SVf, SVfARG(name));
        if (SvPOK(cv))
index 10e3370..51180cf 100644 (file)
--- a/pp_ctl.c
+++ b/pp_ctl.c
@@ -2971,7 +2971,7 @@ S_doeval(pTHX_ int gimme, OP** startop, CV* outside, U32 seq)
        }
        else {
            if (!*msg) {
-               sv_setpv(ERRSV, "Compilation error");
+               sv_setpvs(ERRSV, "Compilation error");
            }
        }
        PERL_UNUSED_VAR(newsp);
diff --git a/toke.c b/toke.c
index e34f796..46066d1 100644 (file)
--- a/toke.c
+++ b/toke.c
@@ -1026,10 +1026,10 @@ S_skipspace(pTHX_ register char *s)
            /* XXX these shouldn't really be added here, can't set PL_faketokens */
            if (PL_minus_p) {
 #ifdef PERL_MAD
-               sv_catpv(PL_linestr,
+               sv_catpvs(PL_linestr,
                         ";}continue{print or die qq(-p destination: $!\\n);}");
 #else
-               sv_setpv(PL_linestr,
+               sv_setpvs(PL_linestr,
                         ";}continue{print or die qq(-p destination: $!\\n);}");
 #endif
                PL_minus_n = PL_minus_p = 0;
@@ -6599,8 +6599,8 @@ Perl_yylex(pTHX)
                    if (PL_madskills)
                        nametoke = newSVpvn(s, d - s);
 #endif
-                   if (strchr(tmpbuf, ':'))
-                       sv_setpv(PL_subname, tmpbuf);
+                   if (memchr(tmpbuf, ':', len))
+                       sv_setpvn(PL_subname, tmpbuf, len);
                    else {
                        sv_setsv(PL_subname,PL_curstname);
                        sv_catpvs(PL_subname,"::");