Mail Archives: djgpp-workers/2013/07/20/02:54:35
> Date: Sat, 20 Jul 2013 02:18:32 +0200
> From: Juan Manuel Guerrero <juan DOT guerrero AT gmx DOT de>
>
> As can be seen djgpp sets _IOEOF were appropriate and this can be checked
> using feof() but it does not set _IOERR under the conditions described in
> previous mails. Below there is a new small patch that fixes the issue as
> suggested, this time in _filbuf for fread an fgets and in _flsbuf for
> fwrite and fputs.
Go ahead and commit it (with changes indicated below). Thanks.
> +@findex fread AT r{, and setting @code{_flag} to @code{_IOERR} if stream has been opened with wrong mode}
> +@findex fwrite AT r{, and setting @code{_flag} to @code{_IOERR} if stream has been opened with wrong mode}
> +@findex fgets AT r{, and setting @code{_flag} to @code{_IOERR} if stream has been opened with wrong mode}
> +@findex fputs AT r{, and setting @code{_flag} to @code{_IOERR} if stream has been opened with wrong mode}
Such long index entries are not useful. I suggest something like
@findex fputs AT r{, and } stream error condition
> +@code{fread}, @code{fwrite}, @code{fgets} and @code{fputs} now check that the file stream has
> +been opened in correct mode. If it is the wrong mode the file stream @code{_flag} flag will
> +be set to @code{_IOERR} before aborting the operation.
Here, you refer to internal variables and flags. It would be much
better to mention the stream error condition, and say that it can be
tested with ferror. Otherwise, only those who know the library
internals will be able to understand the change.
- Raw text -