}
int
-Perl_mode_from_discipline(pTHX_ SV *discp)
+Perl_mode_from_discipline(pTHX_ const char *s, STRLEN len)
{
int mode = O_BINARY;
- if (discp) {
- STRLEN len;
- const char *s = SvPV_const(discp,len);
+ if (s) {
while (*s) {
if (*s == ':') {
switch (s[1]) {
Ap |I32 |mg_size |NN SV* sv
Ap |void |mini_mktime |NN struct tm *ptm
EXp |OP* |mod |NULLOK OP* o|I32 type
-p |int |mode_from_discipline|NULLOK SV* discp
+p |int |mode_from_discipline|NULLOK const char* s|STRLEN len
Ap |const char* |moreswitches |NN const char* s
p |OP* |my |NN OP* o
Ap |NV |my_atof |NN const char *s
#define mod(a,b) Perl_mod(aTHX_ a,b)
#endif
#ifdef PERL_CORE
-#define mode_from_discipline(a) Perl_mode_from_discipline(aTHX_ a)
+#define mode_from_discipline(a,b) Perl_mode_from_discipline(aTHX_ a,b)
#endif
#define moreswitches(a) Perl_moreswitches(aTHX_ a)
#ifdef PERL_CORE
if (table) {
SV **svp = hv_fetchs(table, "open_IN", FALSE);
if (svp && *svp) {
- const I32 mode = mode_from_discipline(*svp);
+ STRLEN len = 0;
+ const char *d = SvPV_const(*svp, len);
+ const I32 mode = mode_from_discipline(d, len);
if (mode & O_BINARY)
o->op_private |= OPpOPEN_IN_RAW;
else if (mode & O_TEXT)
svp = hv_fetchs(table, "open_OUT", FALSE);
if (svp && *svp) {
- const I32 mode = mode_from_discipline(*svp);
+ STRLEN len = 0;
+ const char *d = SvPV_const(*svp, len);
+ const I32 mode = mode_from_discipline(d, len);
if (mode & O_BINARY)
o->op_private |= OPpOPEN_OUT_RAW;
else if (mode & O_TEXT)
PUTBACK;
{
- const int mode = mode_from_discipline(discp);
- const char *const d = (discp ? SvPV_nolen_const(discp) : NULL);
+ STRLEN len = 0;
+ const char *d = NULL;
+ int mode;
+ if (discp)
+ d = SvPV_const(discp, len);
+ mode = mode_from_discipline(d, len);
if (PerlIO_binmode(aTHX_ fp, IoTYPE(io), mode, d)) {
if (IoOFP(io) && IoOFP(io) != IoIFP(io)) {
if (!PerlIO_binmode(aTHX_ IoOFP(io), IoTYPE(io), mode, d)) {
assert(ptm)
PERL_CALLCONV OP* Perl_mod(pTHX_ OP* o, I32 type);
-PERL_CALLCONV int Perl_mode_from_discipline(pTHX_ SV* discp);
+PERL_CALLCONV int Perl_mode_from_discipline(pTHX_ const char* s, STRLEN len);
PERL_CALLCONV const char* Perl_moreswitches(pTHX_ const char* s)
__attribute__nonnull__(pTHX_1);
#define PERL_ARGS_ASSERT_MORESWITCHES \
Use of uninitialized value $m1 in umask at - line 19.
Use of uninitialized value $g1 in umask at - line 20.
Use of uninitialized value $m1 in binmode at - line 23.
-Use of uninitialized value $m1 in binmode at - line 23.
########
use warnings 'uninitialized';
my ($m1);