for (; nfiles; nfiles--, fnamptr++)
{
+ int saved_errno;
if (STREQ (*fnamptr, "-"))
{
have_read_stdin = 1;
delimptr = delims; /* Set up for delimiter string. */
charold = getc (fileptr);
+ saved_errno = errno;
if (charold != EOF)
{
/* `charold' is set up. Hit it!
charold = charnew;
}
+ saved_errno = errno;
/* Hit EOF. Process that last character. */
putc (charold, stdout);
if (ferror (fileptr))
{
- error (0, errno, "%s", *fnamptr);
+ error (0, saved_errno, "%s", *fnamptr);
errors = 1;
}
if (fileptr == stdin)