summaryrefslogtreecommitdiff
path: root/lib/closein.c
diff options
context:
space:
mode:
authorEric Blake <eblake@redhat.com>2011-08-10 05:28:29 -0600
committerEric Blake <eblake@redhat.com>2011-08-10 05:28:29 -0600
commit5b9e0c3ce734b9d9b0c0001e31b65a8a4713700d (patch)
tree8d977eaf78f736c057724281a13cccdfde95eccc /lib/closein.c
parente0a7833645649be1bec1ea92ebd88603a30536a0 (diff)
downloadgnulib-5b9e0c3ce734b9d9b0c0001e31b65a8a4713700d.tar.gz
closein: correct comments
* lib/closein.c (close_stdin): Improve comments. Signed-off-by: Eric Blake <eblake@redhat.com>
Diffstat (limited to 'lib/closein.c')
-rw-r--r--lib/closein.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/closein.c b/lib/closein.c
index beff8bb53a..2a652f4940 100644
--- a/lib/closein.c
+++ b/lib/closein.c
@@ -55,7 +55,7 @@ close_stdin_set_file_name (const char *file)
For example, POSIX requires that these two commands behave alike:
(sed -ne 1q; cat) < file
- tail -n 1 file
+ tail -n +2 file
Since close_stdin is commonly registered via 'atexit', POSIX
and the C standard both say that it should not call 'exit',
@@ -82,7 +82,8 @@ close_stdin (void)
/* There is no need to flush stdin if we can determine quickly that stdin's
input buffer is empty; in this case we know that if stdin is seekable,
- fseeko (stdin, 0, SEEK_CUR) == lseek (0, 0, SEEK_CUR). */
+ (fseeko (stdin, 0, SEEK_CUR), ftello (stdin))
+ == lseek (0, 0, SEEK_CUR). */
if (freadahead (stdin) > 0)
{
/* Only attempt flush if stdin is seekable, as fflush is entitled to