X-Git-Url: http://ncurses.scripts.mit.edu/?p=ncurses.git;a=blobdiff_plain;f=ncurses%2Ftinfo%2Flib_cur_term.c;h=c583aa7edaf5afc14b143114637bf357c9c368e6;hp=516d7e4ed46925fc7d3dcb4e0c0b0c6ffdbbfb7f;hb=3eda6f30a84d53844d2ebceadb457e2e7e9cfbf3;hpb=2e68dc325852af56f2ec6c315b323a4f9c3d62c9 diff --git a/ncurses/tinfo/lib_cur_term.c b/ncurses/tinfo/lib_cur_term.c index 516d7e4e..c583aa7e 100644 --- a/ncurses/tinfo/lib_cur_term.c +++ b/ncurses/tinfo/lib_cur_term.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2014,2016 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.34 2016/05/28 23:22:52 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); @@ -154,6 +159,10 @@ NCURSES_SP_NAME(del_curterm) (NCURSES_SP_DCLx TERMINAL * termp) 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; }