[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: sed bug on seekable stdin
From: |
Bob Proulx |
Subject: |
Re: sed bug on seekable stdin |
Date: |
Sun, 17 Dec 2006 12:13:27 -0700 |
User-agent: |
Mutt/1.5.9i |
Paolo Bonzini wrote:
> --- orig/sed/utils.c
> +++ mod/sed/utils.c
> @@ -328,6 +328,15 @@ ck_fclose(stream)
> {
> do_ck_fclose (stdout);
> do_ck_fclose (stderr);
> +
> + /* When a standard utility reads a seekable input file and terminates
> + without an error before it reaches end-of-file, the utility shall
> ensure
> + that the file offset in the open file description is properly
> positioned
> + just past the last byte processed by the utility. */
> +
> + fflush(stdin);
AFAIK fflush() is not needed in input streams as its purpose is to
flush pending output buffers and input streams have none.
> + fseek(stdin, 0, SEEK_CUR);
> + fclose(stdin);
How are I/O errors on stdin handled in this case?
> }
> }
- sed bug on seekable stdin, Eric Blake, 2006/12/16
- Re: sed bug on seekable stdin, Paolo Bonzini, 2006/12/17
- Re: sed bug on seekable stdin, Eric Blake, 2006/12/17
- Re: sed bug on seekable stdin, Andreas Schwab, 2006/12/17
- Re: sed bug on seekable stdin, Eric Blake, 2006/12/17
- Re: sed bug on seekable stdin, Paul Jarc, 2006/12/17
- Re: sed bug on seekable stdin, Paul Eggert, 2006/12/18
- Re: sed bug on seekable stdin, Eric Blake, 2006/12/18
Re: sed bug on seekable stdin, Paolo Bonzini, 2006/12/18