X-Git-Url: https://ncurses.scripts.mit.edu/?a=blobdiff_plain;ds=sidebyside;f=ncurses%2Ftinfo%2Flib_cur_term.c;h=c583aa7edaf5afc14b143114637bf357c9c368e6;hb=3eda6f30a84d53844d2ebceadb457e2e7e9cfbf3;hp=eaaacbcbe51f9146de687bb097ae93aa63065ea8;hpb=e6319890faa5df5f8cdc9d6bfeb72a3bc3364ed4;p=ncurses.git diff --git a/ncurses/tinfo/lib_cur_term.c b/ncurses/tinfo/lib_cur_term.c index eaaacbcb..c583aa7e 100644 --- a/ncurses/tinfo/lib_cur_term.c +++ b/ncurses/tinfo/lib_cur_term.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2012,2013 Free Software Foundation, Inc. * + * Copyright (c) 1998-2016,2017 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -39,7 +39,7 @@ #include #include /* ospeed */ -MODULE_ID("$Id: lib_cur_term.c,v 1.32 2013/10/28 00:10:27 tom Exp $") +MODULE_ID("$Id: lib_cur_term.c,v 1.36 2017/04/01 17:19:03 tom Exp $") #undef CUR #define CUR termp->type. @@ -104,6 +104,11 @@ NCURSES_SP_NAME(set_curterm) (NCURSES_SP_DCLx TERMINAL * termp) if (termp->type.Strings) { PC = (char) ((pad_char != NULL) ? pad_char[0] : 0); } +#endif +#if !USE_REENTRANT +#define MY_SIZE (size_t) (NAMESIZE - 1) + _nc_STRNCPY(ttytype, termp->type.term_names, MY_SIZE); + ttytype[MY_SIZE] = '\0'; #endif } _nc_unlock_global(curses); @@ -151,9 +156,13 @@ NCURSES_SP_NAME(del_curterm) (NCURSES_SP_DCLx TERMINAL * termp) #endif #ifdef USE_TERM_DRIVER if (TCB->drv) - TCB->drv->release(TCB); + TCB->drv->td_release(TCB); #endif free(termp); +#if NO_LEAKS + /* discard memory used in tgetent's cache for this terminal */ + _nc_tgetent_leak(termp); +#endif rc = OK; } @@ -164,7 +173,7 @@ NCURSES_SP_NAME(del_curterm) (NCURSES_SP_DCLx TERMINAL * termp) NCURSES_EXPORT(int) del_curterm(TERMINAL * termp) { - int rc = ERR; + int rc; _nc_lock_global(curses); rc = NCURSES_SP_NAME(del_curterm) (CURRENT_SCREEN, termp);