don't restore bogon termios struct on setupterm failure #1778

This commit is contained in:
nick black 2021-06-16 16:51:30 -04:00
parent 48876b42fb
commit cf60ff5b94
No known key found for this signature in database
GPG Key ID: 5F43400C21CBFACC

View File

@ -1061,7 +1061,11 @@ notcurses* notcurses_core_init(const notcurses_options* opts, FILE* outfp){
int termerr; int termerr;
if(setupterm(opts->termtype, ret->ttyfd, &termerr) != OK){ if(setupterm(opts->termtype, ret->ttyfd, &termerr) != OK){
fprintf(stderr, "Terminfo error %d (see terminfo(3ncurses))\n", termerr); fprintf(stderr, "Terminfo error %d (see terminfo(3ncurses))\n", termerr);
goto err; drop_signals(ret);
pthread_mutex_destroy(&ret->statlock);
pthread_mutex_destroy(&ret->pilelock);
free(ret);
return NULL;
} }
const char* shortname_term = termname(); const char* shortname_term = termname();
// const char* longname_term = longname(); // const char* longname_term = longname();