* libc/stdio/popen.c (popen): Allow "rb", "rt", "wb", and "wt" arguments for

popen to match similar functionality in fopen.
This commit is contained in:
Christopher Faylor
2002-08-04 19:01:56 +00:00
parent 245e4e8734
commit 4866247e29
2 changed files with 11 additions and 1 deletions

View File

@ -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);
}