Hi,
! /* Patch: This routine used to get the terminal file descriptor with
! 'fileno (stdout)', but this is wrong when our output is being piped
! to a program, as in 'show -form mhl.body | pgpv', causing mhshow to
! hang at the prompt below. If stdout isn't a terminal, get the
! terminal file descriptor using the special "/dev/tty" pseudonym.
! -- Dan Harkless <[EMAIL PROTECTED]>, 1999-04-09 */
! if (tty_FILE == NULL) {
! if (isatty(STDOUT_FILENO))
! tty_FILE = stdout;
! else
! tty_FILE = fopen("/dev/tty", "r+");
! tty_fd = fileno(tty_FILE);
! }
Can we get here without having a /dev/tty? Via a cron job perhaps?
If so, presumably tty_FILE is NULL when passed to fileno()?
Should any prompt be given if *stdin* isn't a terminal?
Ralph.