diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2019-11-01 16:46:12 +0100 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2019-11-01 16:46:12 +0100 |
| commit | 2086cc6598b354bf298b802368807ac66d26fd21 (patch) | |
| tree | c339da55710d8f82b1f2fb810ce321280e1f7079 /bb.c | |
| parent | 66d20ba811587f85774c475f38d94d5959c8f2d0 (diff) | |
Fix for errors that occur before initializing the terminal.
Diffstat (limited to 'bb.c')
| -rw-r--r-- | bb.c | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -147,9 +147,11 @@ void cleanup(void) free(cmdfilename); cmdfilename = NULL; } - fputs(T_OFF(T_ALT_SCREEN) T_ON(T_SHOW_CURSOR), tty_out); - fflush(tty_out); - tcsetattr(fileno(tty_out), TCSANOW, &orig_termios); + if (tty_out) { + fputs(T_OFF(T_ALT_SCREEN) T_ON(T_SHOW_CURSOR), tty_out); + fflush(tty_out); + tcsetattr(fileno(tty_out), TCSANOW, &orig_termios); + } } /* |
