X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=doio.c;h=be27b93b07ec87c83db5dd0e8384f4bf854901f7;hb=8c01da3c85cbf27634336f1caf8397b60cbaa3e2;hp=abf9ae5a17f9da4cc6239a481945800bd20218e1;hpb=5f74f29c8f6f417d66c92da59fd3fa4b09850be6;p=p5sagit%2Fp5-mst-13.2.git diff --git a/doio.c b/doio.c index abf9ae5..be27b93 100644 --- a/doio.c +++ b/doio.c @@ -359,9 +359,6 @@ Perl_do_openn(pTHX_ GV *gv, register char *name, I32 len, int as_raw, } } /* & */ else { - if (num_svs > 1) { - Perl_croak(aTHX_ "More than one argument to '>' open"); - } /*SUPPRESS 530*/ for (; isSPACE(*type); type++) ; if (*type == IoTYPE_STD && (!type[1] || isSPACE(type[1]) || type[1] == ':')) { @@ -369,6 +366,9 @@ Perl_do_openn(pTHX_ GV *gv, register char *name, I32 len, int as_raw, type++; fp = PerlIO_stdout(); IoTYPE(io) = IoTYPE_STD; + if (num_svs > 1) { + Perl_croak(aTHX_ "More than one argument to '>%c' open",IoTYPE_STD); + } } else { if (!num_svs) { @@ -382,9 +382,6 @@ Perl_do_openn(pTHX_ GV *gv, register char *name, I32 len, int as_raw, } /* !& */ } else if (*type == IoTYPE_RDONLY) { - if (num_svs > 1) { - Perl_croak(aTHX_ "More than one argument to '<' open"); - } /*SUPPRESS 530*/ for (type++; isSPACE(*type); type++) ; mode[0] = 'r'; @@ -401,6 +398,9 @@ Perl_do_openn(pTHX_ GV *gv, register char *name, I32 len, int as_raw, type++; fp = PerlIO_stdin(); IoTYPE(io) = IoTYPE_STD; + if (num_svs > 1) { + Perl_croak(aTHX_ "More than one argument to '<%c' open",IoTYPE_STD); + } } else { if (!num_svs) { @@ -951,21 +951,7 @@ Perl_do_eof(pTHX_ GV *gv) if (!io) return TRUE; else if (ckWARN(WARN_IO) && (IoTYPE(io) == IoTYPE_WRONLY)) - { - /* integrate to report_evil_fh()? */ - char *name = NULL; - if (isGV(gv)) { - SV* sv = sv_newmortal(); - gv_efullname4(sv, gv, Nullch, FALSE); - name = SvPV_nolen(sv); - } - if (name && *name) - Perl_warner(aTHX_ WARN_IO, - "Filehandle %s opened only for output", name); - else - Perl_warner(aTHX_ WARN_IO, - "Filehandle opened only for output"); - } + report_evil_fh(gv, io, OP_phoney_OUTPUT_ONLY); while (IoIFP(io)) { @@ -1107,7 +1093,11 @@ Perl_do_binmode(pTHX_ PerlIO *fp, int iotype, int mode) /* The old body of this is now in non-LAYER part of perlio.c * This is a stub for any XS code which might have been calling it. */ - char *name = (O_BINARY != O_TEXT && !(mode & O_BINARY)) ? ":crlf" : ":raw"; + char *name = ":raw"; +#ifdef PERLIO_USING_CRLF + if (!(mode & O_BINARY)) + name = ":crlf"; +#endif return PerlIO_binmode(aTHX_ fp, iotype, mode, name); } @@ -2116,6 +2106,8 @@ Perl_do_shmio(pTHX_ I32 optype, SV **mark, SV **sp) #endif /* SYSV IPC */ /* +=head1 IO Functions + =for apidoc start_glob Function called by C to spawn a glob (or do the glob inside