diff options
author | Christopher Faylor <me@cgf.cx> | 2002-08-04 19:01:56 +0000 |
---|---|---|
committer | Christopher Faylor <me@cgf.cx> | 2002-08-04 19:01:56 +0000 |
commit | 4866247e29af4583a96bd7e594073d25800fe672 (patch) | |
tree | f77b28eb8d0ea4176a21d741345f6dc75901d559 | |
parent | 245e4e87340402f50096291bff2f0c03332c4488 (diff) | |
download | cygnal-4866247e29af4583a96bd7e594073d25800fe672.tar.gz cygnal-4866247e29af4583a96bd7e594073d25800fe672.tar.bz2 cygnal-4866247e29af4583a96bd7e594073d25800fe672.zip |
* libc/stdio/popen.c (popen): Allow "rb", "rt", "wb", and "wt" arguments for
popen to match similar functionality in fopen.
-rw-r--r-- | newlib/ChangeLog | 5 | ||||
-rw-r--r-- | newlib/libc/posix/popen.c | 7 |
2 files changed, 11 insertions, 1 deletions
diff --git a/newlib/ChangeLog b/newlib/ChangeLog index 0ff7f9833..ed5b0c0d0 100644 --- a/newlib/ChangeLog +++ b/newlib/ChangeLog @@ -1,3 +1,8 @@ +2002-08-04 Christopher Faylor <cgf@redhat.com> + + * libc/stdio/popen.c (popen): Allow "rb", "rt", "wb", and "wt" + arguments for popen to match similar functionality in fopen. + 2002-07-29 Pierre Humblet <pierre.humblet@ieee.org> * libc/include/sys/unistd.h: Add setgroups prototype for Cygwin. diff --git a/newlib/libc/posix/popen.c b/newlib/libc/posix/popen.c index d6d174d08..f522c0b9d 100644 --- a/newlib/libc/posix/popen.c +++ b/newlib/libc/posix/popen.c @@ -71,7 +71,12 @@ popen(program, type) FILE *iop; int pdes[2], pid; - if ((*type != 'r' && *type != 'w') || type[1]) { + if ((*type != 'r' && *type != 'w') + || (type[1] +#ifdef __CYGWIN__ + && (type[2] || (type[1] != 'b' && type[1] != 't')) +#endif + )) { errno = EINVAL; return (NULL); } |