diff options
| author | Nate Williams <nate@FreeBSD.org> | 1996-12-03 21:56:15 +0000 |
|---|---|---|
| committer | Nate Williams <nate@FreeBSD.org> | 1996-12-03 21:56:15 +0000 |
| commit | e744d38673abfc957465a29a25e9cde912a802d8 (patch) | |
| tree | cc698233b7c99a5d4f5ee226fe4c0c0a23f19f52 /gnu/usr.bin | |
| parent | 680026d67a2c06397cada220ac4300f0e42c90e1 (diff) | |
Notes
Diffstat (limited to 'gnu/usr.bin')
| -rw-r--r-- | gnu/usr.bin/perl/perl/doio.c | 22 | ||||
| -rw-r--r-- | gnu/usr.bin/perl/perl/tdoio.c | 23 |
2 files changed, 43 insertions, 2 deletions
diff --git a/gnu/usr.bin/perl/perl/doio.c b/gnu/usr.bin/perl/perl/doio.c index 9c0731f6099f..0ace3773f9dd 100644 --- a/gnu/usr.bin/perl/perl/doio.c +++ b/gnu/usr.bin/perl/perl/doio.c @@ -1,4 +1,4 @@ -/* $RCSfile: doio.c,v $$Revision: 1.2 $$Date: 1994/09/11 03:17:32 $ +/* $RCSfile: doio.c,v $$Revision: 1.3 $$Date: 1995/05/30 05:03:00 $ * * Copyright (c) 1991, Larry Wall * @@ -6,6 +6,9 @@ * License or the Artistic License, as specified in the README file. * * $Log: doio.c,v $ + * Revision 1.3 1995/05/30 05:03:00 rgrimes + * Remove trailing whitespace. + * * Revision 1.2 1994/09/11 03:17:32 gclarkii * Changed AF_LOCAL to AF_LOCAL_XX so as not to conflict with 4.4 socket.h * Added casts to shutup warnings in doio.c @@ -1221,8 +1224,25 @@ STR *str; len = stio->ifp->_cnt + (stio->ifp->_ptr - stio->ifp->_base); s = stio->ifp->_base; #else +#if (defined(BSD) && (BSD >= 199103)) + fstat(fileno(stio->ifp),&statcache); + if (S_ISDIR(statcache.st_mode)) /* handle NFS glitch */ + return arg->arg_type == O_FTTEXT ? &str_no : &str_yes; + + if (stio->ifp->_bf._size <= 0) { + i = getc(stio->ifp); + if (i != EOF) + (void)ungetc(i,stio->ifp); + } + + if (stio->ifp->_bf._size <= 0) + return &str_yes; + len = stio->ifp->_bf._size+(stio->ifp->_p - stio->ifp->_bf._base); + s = stio->ifp->_bf._base; +#else fatal("-T and -B not implemented on filehandles"); #endif +#endif } else { if (dowarn) diff --git a/gnu/usr.bin/perl/perl/tdoio.c b/gnu/usr.bin/perl/perl/tdoio.c index 1cd6269e8c70..cd5d480bcb80 100644 --- a/gnu/usr.bin/perl/perl/tdoio.c +++ b/gnu/usr.bin/perl/perl/tdoio.c @@ -1,4 +1,4 @@ -/* $RCSfile: tdoio.c,v $$Revision: 1.1.1.1 $$Date: 1994/09/10 06:27:36 $ +/* $RCSfile: tdoio.c,v $$Revision: 1.2 $$Date: 1995/05/30 05:03:23 $ * * Copyright (c) 1991, Larry Wall * @@ -6,6 +6,9 @@ * License or the Artistic License, as specified in the README file. * * $Log: tdoio.c,v $ + * Revision 1.2 1995/05/30 05:03:23 rgrimes + * Remove trailing whitespace. + * * Revision 1.1.1.1 1994/09/10 06:27:36 gclarkii * Initial import of Perl 4.046 bmaked * @@ -1214,8 +1217,26 @@ STR *str; len = stio->ifp->_cnt + (stio->ifp->_ptr - stio->ifp->_base); s = stio->ifp->_base; #else +#if (defined(BSD) && (BSD >= 199103)) + s = stio->ifp->_base; + fstat(fileno(stio->ifp),&statcache); + if (S_ISDIR(statcache.st_mode)) /* handle NFS glitch */ + return arg->arg_type == O_FTTEXT ? &str_no : &str_yes; + + if (stio->ifp->_bf._size <= 0) { + i = getc(stio->ifp); + if (i != EOF) + (void)ungetc(i,stio->ifp); + } + + if (stio->ifp->_bf._size <= 0) + return &str_yes; + len = stio->ifp->_bf._size+(stio->ifp->_p - stio->ifp->_bf._base); + s = stio->ifp->_bf._base; +#else fatal("-T and -B not implemented on filehandles"); #endif +#endif } else { if (dowarn) |
