From 848ef95539b9ac5bb84d1c24074fa4a1e19c3dfb Mon Sep 17 00:00:00 2001 From: Nicholas Clark Date: Mon, 13 Jun 2005 20:17:56 +0000 Subject: More SvPV consting p4raw-id: //depot/perl@24826 --- perl.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/perl.c b/perl.c index 09927866cf..216923cdf6 100644 --- a/perl.c +++ b/perl.c @@ -3178,7 +3178,8 @@ S_open_script(pTHX_ const char *scriptname, bool dosearch, SV *sv) DEBUG_P(PerlIO_printf(Perl_debug_log, "PL_preprocess: scriptname=\"%s\", cpp=\"%s\", sv=\"%s\", CPPMINUS=\"%s\"\n", - scriptname, SvPVX (cpp), SvPVX (sv), CPPMINUS)); + scriptname, SvPVX_const (cpp), SvPVX_const (sv), + CPPMINUS)); # if defined(MSDOS) || defined(WIN32) || defined(VMS) quote = "\""; @@ -3219,9 +3220,9 @@ S_open_script(pTHX_ const char *scriptname, bool dosearch, SV *sv) DEBUG_P(PerlIO_printf(Perl_debug_log, "PL_preprocess: cmd=\"%s\"\n", - SvPVX(cmd))); + SvPVX_const(cmd))); - PL_rsfp = PerlProc_popen(SvPVX(cmd), (char *)"r"); + PL_rsfp = PerlProc_popen((char *)SvPVX_const(cmd), (char *)"r"); SvREFCNT_dec(cmd); SvREFCNT_dec(cpp); } @@ -4359,7 +4360,7 @@ STATIC SV * S_incpush_if_exists(pTHX_ SV *dir) { Stat_t tmpstatbuf; - if (PerlLIO_stat(SvPVX(dir), &tmpstatbuf) >= 0 && + if (PerlLIO_stat(SvPVX_const(dir), &tmpstatbuf) >= 0 && S_ISDIR(tmpstatbuf.st_mode)) { av_push(GvAVn(PL_incgv), dir); dir = NEWSV(0,0); @@ -4837,11 +4838,11 @@ S_my_exit_jump(pTHX) static I32 read_e_script(pTHX_ int idx, SV *buf_sv, int maxlen) { - char *p, *nl; + const char *p, *nl; (void)idx; (void)maxlen; - p = SvPVX(PL_e_script); + p = SvPVX_const(PL_e_script); nl = strchr(p, '\n'); nl = (nl) ? nl+1 : SvEND(PL_e_script); if (nl-p == 0) { -- cgit v1.2.1