/* Get frame size from system, or else from termcap. */
{
int height, width;
- get_tty_size (tty, &width, &height);
+ get_tty_size (fileno (TTY_INPUT (tty)), &width, &height);
FrameCols (tty) = width;
FrameRows (tty) = height;
}
&& tty->TS_end_standout_mode
&& !strcmp (tty->TS_standout_mode, tty->TS_end_standout_mode));
- UseTabs (tty) = tabs_safe_p (tty) && TabWidth (tty) == 8;
+ UseTabs (tty) = tabs_safe_p (fileno (TTY_INPUT (tty))) && TabWidth (tty) == 8;
TTY_SCROLL_REGION_OK (tty)
= (tty->Wcm->cm_abs
TTY_FAST_CLEAR_END_OF_LINE (tty) = tty->TS_clr_line != 0;
- init_baud_rate (tty);
+ init_baud_rate (fileno (TTY_INPUT (tty)));
if (read_socket_hook) /* Baudrate is somewhat
meaningless in this case */
baud_rate = 9600;
if (tty->input)
fclose (tty->input);
- if (tty->output)
+ if (tty->output && tty->output != tty->input)
fclose (tty->output);
if (tty->termscript)
fclose (tty->termscript);
if (tty->old_tty)
xfree (tty->old_tty);
-#if 0 /* XXX There is a dangling reference somewhere into this. */
if (tty->Wcm)
xfree (tty->Wcm);
-#endif
bzero (tty, sizeof (struct tty_output));
xfree (tty);