the same and the file descriptors correspond to stdin and stdout.
This is necessary on at least Digital UNIX (aka OSF1) 3.2C.
Otherwise, running `cat << X > $$' would fail with `cat: -: input
file is output file'. From Jarkko Hietaniemi <jhi@epsilon.hut.fi>.
files cannot be redirected to themselves. */
if (check_redirection
- && stat_buf.st_dev == out_dev && stat_buf.st_ino == out_ino)
+ && stat_buf.st_dev == out_dev && stat_buf.st_ino == out_ino
+ && (input_desc != fileno (stdin) || output_desc != fileno (stdout)))
{
error (0, 0, _("%s: input file is output file"), infile);
exit_stat = 1;