summaryrefslogtreecommitdiff
path: root/doio.c
diff options
context:
space:
mode:
authorDavid Mitchell <davem@iabyn.com>2010-07-03 14:24:11 +0100
committerDavid Mitchell <davem@iabyn.com>2010-07-03 16:25:59 +0100
commit0d7d409d8d92b77ed7de5b74ab047eced86edfc3 (patch)
treefe3c9d84e4283e03a927b8ed309abc3415be8d31 /doio.c
parent79a8d5295c08d08001ca69256d5a990d05ee1556 (diff)
downloadperl-0d7d409d8d92b77ed7de5b74ab047eced86edfc3.tar.gz
add my_[l]stat_flags(); make my_[l]stat() mathoms
my_stat() and my_lstat() call get magic on the stack arg, so create _flags() variants that allow us to control this. (I can't just change the signature or the mg_get() behaviour since my_[l]stat() are listed as being in the public API, even though they're undocumented.)
Diffstat (limited to 'doio.c')
-rw-r--r--doio.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/doio.c b/doio.c
index 06f2d3d4c3..5f57b38fb0 100644
--- a/doio.c
+++ b/doio.c
@@ -1258,7 +1258,7 @@ Perl_do_print(pTHX_ register SV *sv, PerlIO *fp)
}
I32
-Perl_my_stat(pTHX)
+Perl_my_stat_flags(pTHX_ const U32 flags)
{
dVAR;
dSP;
@@ -1314,7 +1314,7 @@ Perl_my_stat(pTHX)
goto do_fstat_have_io;
}
- s = SvPV_const(sv, len);
+ s = SvPV_flags_const(sv, len, flags);
PL_statgv = NULL;
sv_setpvn(PL_statname, s, len);
s = SvPVX_const(PL_statname); /* s now NUL-terminated */
@@ -1328,7 +1328,7 @@ Perl_my_stat(pTHX)
I32
-Perl_my_lstat(pTHX)
+Perl_my_lstat_flags(pTHX_ const U32 flags)
{
dVAR;
static const char no_prev_lstat[] = "The stat preceding -l _ wasn't an lstat";
@@ -1361,7 +1361,7 @@ Perl_my_lstat(pTHX)
GvENAME((const GV *)SvRV(sv)));
return (PL_laststatval = -1);
}
- file = SvPV_nolen_const(sv);
+ file = SvPV_flags_const_nolen(sv, flags);
sv_setpv(PL_statname,file);
PL_laststatval = PerlLIO_lstat(file,&PL_statcache);
if (PL_laststatval < 0 && ckWARN(WARN_NEWLINE) && strchr(file, '\n'))