diff options
author | Nick Ing-Simmons <nik@tiuk.ti.com> | 2002-05-15 19:26:00 +0000 |
---|---|---|
committer | Nick Ing-Simmons <nik@tiuk.ti.com> | 2002-05-15 19:26:00 +0000 |
commit | 0cff2cf3dc85787c2786f644ac6406c6b5148dad (patch) | |
tree | d59c782a5362209673601425a3e0274ab0a72cf4 /perlio.c | |
parent | 84dc725ede41be18dae9c782ef6d2c34d4ad6507 (diff) | |
download | perl-0cff2cf3dc85787c2786f644ac6406c6b5148dad.tar.gz |
Make open fail when layer string does not parse.
p4raw-id: //depot/perlio@16613
Diffstat (limited to 'perlio.c')
-rw-r--r-- | perlio.c | 13 |
1 files changed, 11 insertions, 2 deletions
@@ -805,6 +805,7 @@ PerlIO_parse_layers(pTHX_ PerlIO_list_t *av, const char *names) Perl_warner(aTHX_ packWARN(WARN_LAYER), "perlio: invalid separator character %c%c%c in layer specification list %s", q, *s, q, s); + SETERRNO(EINVAL, LIB$_INVARG); return -1; } do { @@ -1287,8 +1288,13 @@ PerlIO_resolve_layers(pTHX_ const char *layers, else { av = def; } - PerlIO_parse_layers(aTHX_ av, layers); - return av; + if (PerlIO_parse_layers(aTHX_ av, layers) == 0) { + return av; + } + else { + PerlIO_list_free(aTHX_ av); + return (PerlIO_list_t *) NULL; + } } else { if (incdef) @@ -1330,6 +1336,9 @@ PerlIO_openn(pTHX_ const char *layers, const char *mode, int fd, } else { layera = PerlIO_resolve_layers(aTHX_ layers, mode, narg, args); + if (!layera) { + return NULL; + } } /* * Start at "top" of layer stack |