summaryrefslogtreecommitdiff
path: root/perl.c
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2005-06-13 20:17:56 +0000
committerNicholas Clark <nick@ccl4.org>2005-06-13 20:17:56 +0000
commit848ef95539b9ac5bb84d1c24074fa4a1e19c3dfb (patch)
treec5560fc2718b1e4eaa8718b3088c0fbd00703132 /perl.c
parent9e7cf449d83cd5f918126cacc6de91f23f4d9822 (diff)
downloadperl-848ef95539b9ac5bb84d1c24074fa4a1e19c3dfb.tar.gz
More SvPV consting
p4raw-id: //depot/perl@24826
Diffstat (limited to 'perl.c')
-rw-r--r--perl.c13
1 files 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) {