summaryrefslogtreecommitdiff
path: root/doio.c
diff options
context:
space:
mode:
authorNick Ing-Simmons <nik@tiuk.ti.com>2002-06-06 07:26:11 +0000
committerNick Ing-Simmons <nik@tiuk.ti.com>2002-06-06 07:26:11 +0000
commit1771866f7afe018493c12f00d922f47bd58a664e (patch)
tree3ccbea58d0b272324f413c2e06b10b0f2ec6ff4c /doio.c
parent9856d93935533919f70e55e417b4059f09d09a01 (diff)
downloadperl-1771866f7afe018493c12f00d922f47bd58a664e.tar.gz
doio.c tweaks
- see SV passed to dup type open "looks_like__number" - apply layers to pipe opens. p4raw-id: //depot/perlio@17030
Diffstat (limited to 'doio.c')
-rw-r--r--doio.c21
1 files changed, 16 insertions, 5 deletions
diff --git a/doio.c b/doio.c
index decd1885a4..0be42df8c1 100644
--- a/doio.c
+++ b/doio.c
@@ -254,10 +254,6 @@ Perl_do_openn(pTHX_ GV *gv, register char *name, I32 len, int as_raw,
name = type;
len = tend-type;
}
- else {
- if (*type)
- goto unknown_desr;
- }
if (*name == '\0') {
/* command is missing 19990114 */
if (ckWARN(WARN_PIPE))
@@ -285,6 +281,13 @@ Perl_do_openn(pTHX_ GV *gv, register char *name, I32 len, int as_raw,
else {
fp = PerlProc_popen(name,mode);
}
+ if (num_svs) {
+ if (*type) {
+ if (PerlIO_apply_layers(aTHX_ fp, mode, type) != 0) {
+ goto say_false;
+ }
+ }
+ }
}
else if (*type == IoTYPE_WRONLY) {
TAINT_PROPER("open");
@@ -320,7 +323,7 @@ Perl_do_openn(pTHX_ GV *gv, register char *name, I32 len, int as_raw,
if (num_svs > 1) {
Perl_croak(aTHX_ "More than one argument to '%c&' open",IoTYPE(io));
}
- if (num_svs && SvIOK(*svp)) {
+ if (num_svs && (SvIOK(*svp) || (SvPOK(*svp) && looks_like_number(*svp)))) {
fd = SvUV(*svp);
}
else if (isDIGIT(*type)) {
@@ -487,6 +490,14 @@ Perl_do_openn(pTHX_ GV *gv, register char *name, I32 len, int as_raw,
fp = PerlProc_popen(name,mode);
}
IoTYPE(io) = IoTYPE_PIPE;
+ if (num_svs) {
+ for (; isSPACE(*type); type++) ;
+ if (*type) {
+ if (PerlIO_apply_layers(aTHX_ fp, mode, type) != 0) {
+ goto say_false;
+ }
+ }
+ }
}
else {
if (num_svs)