Hello community, here is the log from the commit of package ncurses checked in at Wed Apr 9 21:39:41 CEST 2008. -------- --- ncurses/ncurses.changes 2007-12-10 15:12:04.000000000 +0100 +++ ncurses/ncurses.changes 2008-04-09 17:40:10.414028000 +0200 @@ -1,0 +2,7 @@ +Wed Apr 8 19:20:00 CEST 2008 - werner@suse.de + +- New sub package libncurses5 including the shared libraries and + the required terminfo and termset data files. +- Include the patch for coverity report + +------------------------------------------------------------------- New: ---- ncurses-5.6-coverity.patch ncurses-rpmlintrc README.devel ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ ncurses.spec ++++++ --- /var/tmp/diff_new_pack.G29552/_old 2008-04-09 21:36:49.000000000 +0200 +++ /var/tmp/diff_new_pack.G29552/_new 2008-04-09 21:36:49.000000000 +0200 @@ -1,7 +1,7 @@ # # spec file for package ncurses (Version 5.6) # -# Copyright (c) 2007 SUSE LINUX Products GmbH, Nuernberg, Germany. +# Copyright (c) 2008 SUSE LINUX Products GmbH, Nuernberg, Germany. # This file and all modifications and additions to the pristine # package are under the same license as the package itself. # @@ -10,29 +10,35 @@ # norootforbuild + Name: ncurses #!BuildIgnore: terminfo BuildRequires: gcc-c++ gpm %define terminfo() %{_datadir}/%{0}/%{1} %define tabset() %{_datadir}/%{0}/%{1} License: X11/MIT -Group: System/Libraries +Group: System/Base AutoReqProv: on Version: 5.6 -Release: 52 +Release: 71 Summary: New curses Libraries -Source0: ncurses-%{version}.tar.bz2 +Source0: ncurses-5.6.tar.bz2 Url: http://invisible-island.net/ncurses/ncurses.html Source1: ncurses-%{version}-20070128-patch.tar.bz2 Source2: handle.linux +Source3: README.devel +Source4: ncurses-rpmlintrc Patch0: ncurses-%{version}.dif Patch1: ncurses-5.3-printw.dif Patch2: ncurses-5.6-pthread.dif Patch3: ncurses-5.6-overwrite.dif +Patch4: ncurses-5.6-coverity.patch BuildRoot: %{_tmppath}/%{name}-%{version}-build %global _sysconfdir /etc %global _miscdir %{_datadir}/misc %global _incdir %{_includedir} +%global root %{_tmppath}/%{name}-%{version}-store +%global abi %(ver=%{version}; echo ${ver%.*}) %description As soon as a text application needs to directly control its output to @@ -51,6 +57,28 @@ Juergen Pfeifer <Juergen.Pfeifer@t-online.de> Pavel Curtis +%package -n libncurses5 +License: X11/MIT +Summary: The New curses Libraries +Group: System/Libraries +Provides: ncurses:/%{_lib}/libncurses.so.5 +Requires: ncurses +AutoReqProv: on + +%description -n libncurses5 +The ncurses library is used by the most curses based terminal +applications for controling its output and input to the screen. + + + +Authors: +-------- + Zeyd M. Ben-Halim <zmbenhal@netcom.com> + Eric S. Raymond <esr@thyrsus.com> + Thomas E. Dickey <dickey@invisible-island.net> + Juergen Pfeifer <Juergen.Pfeifer@t-online.de> + Pavel Curtis + %package -n terminfo Summary: A terminal descriptions database License: Public Domain, Freeware @@ -123,6 +151,7 @@ %patch -P 1 -p0 -b .va %patch -P 2 -p0 -b .pt %patch -P 3 -p0 -b .ow +%patch -P 4 -p0 -b .cv %patch -P 0 -p0 %build @@ -131,15 +160,15 @@ FALLBK="xterm,linux,vt100,vt102" CC=gcc CXX=g++ + CFLAGS="${RPM_OPT_FLAGS} -pipe -D_REENTRANT" if [[ "$BUILD_BASENAME" = debug-* ]] ; then - CFLAGS="${RPM_OPT_FLAGS} -pipe -g -DTRACE" - else - CFLAGS="${RPM_OPT_FLAGS} -pipe" + CFLAGS="${CFLAGS} -g -DTRACE" fi - # LDFLAGS="-Wl,-Bsymbolic-functions" CXXFLAGS=$CFLAGS + # LDFLAGS="-Wl,-Bsymbolic-functions" test -n "$TERM" || TERM=linux - export CC CFLAGS CXX CXXFLAGS TERM LDFLAGS + GZIP="-9" + export CC CFLAGS CXX CXXFLAGS GZIP TERM LDFLAGS # # Detect 64bit architecures and be sure that # we use an unsigned long for chtype to be @@ -150,6 +179,7 @@ WITHCHTYPE="--with-chtype=long" else WITHCHTYPE="" + CFLAGS="${CFLAGS} -D_LARGEFILE64_SOURCES -D_FILE_OFFSET_BITS=64" fi rm -f ./test64 # @@ -193,6 +223,10 @@ --enable-symlinks \ --enable-sigwinch \ --enable-colorfgbg \ +%if %abi >= 6 + --enable-ext-mouse \ +%endif + --enable-wgetch-events \ --prefix=%{_prefix} \ --exec-prefix=%{_prefix}\ --libdir=%{_libdir} \ @@ -200,8 +234,7 @@ --mandir=%{_mandir} \ --includedir=%{_incdir} \ "${WITHCHTYPE}" \ - --with-ticlib=tic \ - --with-install-prefix=%{buildroot} + --with-ticlib=tic # # This is a hack to be able to boot strap # a libncurses with correct fallback.c. @@ -223,27 +256,45 @@ cd ../ PATH=$OPATH # + # Refresh second install path + # + rm -rf %{root} + mkdir %{root} + # # Now rebuild libncurses and do the rest of this job # - make - GZIP="-9" - export GZIP - test -n "%{buildroot}" && rm -rf %{buildroot}/* - make install + make && make install DESTDIR=%{root} includedir=%{_incdir} + # + # The configure line + # + c=`grep '^ *$ *./configure' config.log` # # Now use --enable-widec for UTF8/wide character support. # The libs with 16 bit wide characters are binary incompatible # to the normal 8bit wide character libs. # - c=`grep '^ *$ *./configure' config.log` - eval ./${c#*./} --enable-widec --without-normal - make +%if %abi >= 6 + eval ./${c#*./} --enable-widec --enable-ext-colors --without-progs +%else + eval ./${c#*./} --enable-widec --without-progs +%endif + make && make install.libs install.includes DESTDIR=%{root} includedir=%{_incdir}/ncursesw + for h in %{root}%{_incdir}/ncursesw/*.h ; do + test -e "$h" || continue + h=${h##*/} + for t in %{root}%{_incdir}/ncursesw/*.h ; do + test -e "$t" || continue + test ! -L $t || continue + sed -ri "s;(#include[[:blank:]]+<)(${h}>);\1ncursesw/\2;" $t + done + done %install GZIP="-9" export GZIP - make install.libs install.includes - mkdir -p %{buildroot}/%{_lib} + (cd %{root}/; tar -cpsSf - *)|tar -xpsSf - -C %{buildroot}/ + rm -rf %{root} + mkdir %{buildroot}/%{_lib} for lib in libncurses libncursesw do mv %{buildroot}%{_libdir}/${lib}.so.* %{buildroot}/%{_lib}/ @@ -261,6 +312,7 @@ install -m 644 doc/ncurses-intro.txt.bz2 %{buildroot}%{_defaultdocdir}/ncurses/ bzip2 doc/hackguide.doc -c > doc/hackguide.txt.bz2 install -m 644 doc/hackguide.txt.bz2 %{buildroot}%{_defaultdocdir}/ncurses/ + install -m 644 %{S:3} %{buildroot}%{_defaultdocdir}/ncurses/ mkdir -p %{buildroot}%{_sysconfdir} mkdir -p %{buildroot}%{_miscdir} cd ncurses/ @@ -326,37 +378,24 @@ > extension.list rm -f %{buildroot}%{_prefix}/lib/terminfo mkdir -p %{buildroot}%{_incdir}/ncurses - mkdir -p %{buildroot}%{_incdir}/ncursesw - cat > %{buildroot}%{_incdir}/ncursesw/ncurses.h <<-"EOF" - #ifndef _XOPEN_SOURCE_EXTENDED - #define _XOPEN_SOURCE_EXTENDED - #endif - #ifndef __NCURSES_H - #include_next <ncurses.h> - #endif - EOF ln -sf ../ncurses.h %{buildroot}%{_incdir}/ncurses/ -%post -p /sbin/ldconfig +%post -n libncurses5 -p /sbin/ldconfig -%postun -p /sbin/ldconfig +%postun -n libncurses5 -p /sbin/ldconfig %files -f default.list %defattr(-,root,root) -#%ghost %{_prefix}/lib/tabset -#%ghost %{_prefix}/lib/terminfo +%{_sysconfdir}/termcap +%config %{_miscdir}/termcap %dir %{_datadir}/tabset/ %dir %{_datadir}/terminfo/ %dir %{_datadir}/terminfo/*/ -%{_sysconfdir}/termcap -%config %{_miscdir}/termcap -/%{_lib}/lib*.so.* %{_bindir}/clear %{_bindir}/reset %{_bindir}/toe %{_bindir}/tput %{_bindir}/tset -%{_libdir}/lib*.so.* %doc %{_mandir}/man1/clear.1.gz %doc %{_mandir}/man1/reset.1.gz %doc %{_mandir}/man1/toe.1.gz @@ -364,6 +403,11 @@ %doc %{_mandir}/man1/tset.1.gz %doc %{_mandir}/man5/*.gz +%files -n libncurses5 +%defattr(-,root,root) +/%{_lib}/lib*.so.* +%{_libdir}/lib*.so.* + %files -n ncurses-devel %defattr(-,root,root) %dir %{_defaultdocdir}/ncurses/ @@ -376,8 +420,7 @@ %dir %{_incdir}/ncurses/ %dir %{_incdir}/ncursesw/ %{_incdir}/*.h -%{_incdir}/ncurses/*.h -%{_incdir}/ncursesw/*.h +%{_incdir}/ncurses*/*.h %{_libdir}/lib*.a %{_libdir}/lib*.so %doc %{_mandir}/man1/captoinfo.1.gz ++++++ ncurses-5.6-coverity.patch ++++++ --- NEWS +++ NEWS 2007-04-07 18:55:45.000000000 +0200 @@ -103,6 +103,36 @@ it is not possible to add this informati + modify shared-library rules to allow FreeBSD 3.x to use rpath. + update config.guess, config.sub +20060407 + > other fixes prompted by inspection for Coverity report: + + modify ifdef's for c++ binding to use try/catch/throw statements + + add a null-pointer check in tack/ansi.c request_cfss() + + fix a memory leak in ncurses/base/wresize.c + + corrected check for valid memu/meml capabilities in + progs/dump_entry.c when handling V_HPUX case. + > fixes based on Coverity report: + + remove dead code in test/bs.c + + remove dead code in test/demo_defkey.c + + remove an unused assignment in progs/infocmp.c + + fix a limit check in tack/ansi.c tools_charset() + + fix tack/ansi.c tools_status() to perform the VT320/VT420 + tests in request_cfss(). The function had exited too soon. + + fix a memory leak in tic.c's make_namelist() + + fix a couple of places in tack/output.c which did not check for EOF. + + fix a loop-condition in test/bs.c + + add index checks in lib_color.c for color palettes + + add index checks in progs/dump_entry.c for version_filter() handling + of V_BSD case. + + fix a possible null-pointer dereference in copywin() + + fix a possible null-pointer dereference in waddchnstr() + + add a null-pointer check in _nc_expand_try() + + add a null-pointer check in tic.c's make_namelist() + + add a null-pointer check in _nc_expand_try() + + add null-pointer checks in test/cardfile.c + + fix a double-free in ncurses/tinfo/trim_sgr0.c + + fix a double-free in ncurses/base/wresize.c + + add try/catch block to c++/cursesmain.cc + 20061217 5.6 release for upload to ftp.gnu.org 20061217 --- configure +++ configure 2007-04-07 00:54:52.000000000 +0200 @@ -13892,7 +13892,7 @@ ac_link='$CXX -o conftest$ac_exeext $CXX ac_compiler_gnu=$ac_cv_cxx_compiler_gnu ac_main_return=return -for ac_header in typeinfo +for ac_header in iostream typeinfo do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` echo "$as_me:13893: checking for $ac_header" >&5 --- configure.in +++ configure.in 2007-04-07 00:53:21.000000000 +0200 @@ -1210,7 +1210,7 @@ if test -n "$CXX" ; then ;; esac - AC_CHECK_HEADERS(typeinfo) + AC_CHECK_HEADERS(iostream typeinfo) CF_BOOL_DECL CF_BOOL_SIZE --- c++/cursesmain.cc +++ c++/cursesmain.cc 2008-04-09 17:57:56.093616466 +0200 @@ -34,6 +34,13 @@ #include "internal.h" #include "cursesapp.h" +#if CPP_HAS_TRY_CATCH && HAVE_IOSTREAM +#include <iostream> +#else +#undef CPP_HAS_TRY_CATCH +#define CPP_HAS_TRY_CATCH 0 +#endif + MODULE_ID("$Id: cursesmain.cc,v 1.13 2007/01/27 20:29:27 tom Exp $") #if HAVE_LOCALE_H @@ -62,8 +69,20 @@ int main(int argc, char* argv[]) A->handleArgs(argc,argv); ::endwin(); +#if CPP_HAS_TRY_CATCH + try { + res = (*A)(); + ::endwin(); + } + catch(const NCursesException &e) { + ::endwin(); + std::cerr << e.message << std::endl; + res = e.errorno; + } +#else res = (*A)(); ::endwin(); +#endif #if NO_LEAKS delete A; _nc_free_and_exit(res); --- c++/cursesp.h +++ c++/cursesp.h 2007-04-07 02:47:22.000000000 +0200 @@ -83,7 +83,7 @@ protected: return uptr->m_user; } - void OnError (int err) const THROWS((NCursesPanelException)) + void OnError (int err) const THROWS(NCursesPanelException) { if (err==ERR) THROW(new NCursesPanelException (this, err)); --- c++/etip.h.in +++ c++/etip.h.in 2007-04-07 02:49:39.000000000 +0200 @@ -330,23 +330,33 @@ public: inline void THROW(const NCursesException *e) { #if defined(__GNUG__) && defined(__EXCEPTIONS) # if ((__GNUG__ <= 2) && (__GNUC_MINOR__ < 8)) - (*lib_error_handler)(e?e->classname():"",e?e->message:""); + (*lib_error_handler)(e ? e->classname() : "", e ? e->message : ""); #else - throw *e; +#define CPP_HAS_TRY_CATCH 1 #endif #elif defined(__SUNPRO_CC) # if !defined(__SUNPRO_CC_COMPAT) || (__SUNPRO_CC_COMPAT < 5) genericerror(1, ((e != 0) ? (char *)(e->message) : "")); #else - throw *e; +#define CPP_HAS_TRY_CATCH 1 #endif #else if (e) cerr << e->message << endl; exit(0); #endif -} -#define THROWS(s) +#ifndef CPP_HAS_TRY_CATCH +#define CPP_HAS_TRY_CATCH 0 +#define NCURSES_CPP_TRY /* nothing */ +#define NCURSES_CPP_CATCH(e) if (false) +#define THROWS(s) /* nothing */ +#elif CPP_HAS_TRY_CATCH + throw *e; +#define NCURSES_CPP_TRY try +#define NCURSES_CPP_CATCH(e) catch(e) +#define THROWS(s) throw(s) +#endif +} #endif /* NCURSES_ETIP_H_incl */ --- include/ncurses_defs +++ include/ncurses_defs 2007-04-07 00:54:16.000000000 +0200 @@ -68,6 +68,7 @@ HAVE_GPM_H HAVE_GPP_BUILTIN_H HAVE_GXX_BUILTIN_H HAVE_HAS_KEY +HAVE_IOSTREAM HAVE_ISASCII HAVE_ISSETUGID HAVE_LANGINFO_CODESET --- ncurses/base/lib_addstr.c +++ ncurses/base/lib_addstr.c 2007-04-04 02:41:25.000000000 +0200 @@ -80,8 +80,7 @@ waddnstr(WINDOW *win, const char *astr, NCURSES_EXPORT(int) waddchnstr(WINDOW *win, const chtype *astr, int n) { - NCURSES_SIZE_T y = win->_cury; - NCURSES_SIZE_T x = win->_curx; + NCURSES_SIZE_T y, x; int code = OK; int i; struct ldat *line; @@ -91,6 +90,8 @@ waddchnstr(WINDOW *win, const chtype *as if (!win) returnCode(ERR); + y = win->_cury; + x = win->_curx; if (n < 0) { const chtype *str; n = 0; --- ncurses/base/lib_color.c +++ ncurses/base/lib_color.c 2007-04-04 22:32:04.000000000 +0200 @@ -56,7 +56,10 @@ NCURSES_EXPORT_VAR(int) COLORS = 0; #define TYPE_CALLOC(type,elts) typeCalloc(type, (unsigned)(elts)) +#define MAX_PALETTE 8 + #define OkColorHi(n) (((n) < COLORS) && ((n) < max_colors)) +#define InPalette(n) ((n) >= 0 && (n) < MAX_PALETTE) /* * Given a RGB range of 0..1000, we'll normally set the individual values @@ -162,10 +165,10 @@ init_color_table(void) tp = (hue_lightness_saturation) ? hls_palette : cga_palette; for (n = 0; n < COLORS; n++) { - if (n < 8) { + if (InPalette(n)) { SP->_color_table[n] = tp[n]; } else { - SP->_color_table[n] = tp[n % 8]; + SP->_color_table[n] = tp[n % MAX_PALETTE]; if (hue_lightness_saturation) { SP->_color_table[n].green = 100; } else { @@ -365,7 +368,7 @@ init_pair(short pair, short f, short b) if (GET_SCREEN_PAIR(SP) == pair) SET_SCREEN_PAIR(SP, (chtype) (~0)); /* force attribute update */ - if (initialize_pair) { + if (initialize_pair && InPalette(f) && InPalette(b)) { const color_t *tp = hue_lightness_saturation ? hls_palette : cga_palette; TR(TRACE_ATTRS, --- ncurses/base/lib_overlay.c +++ ncurses/base/lib_overlay.c 2007-04-04 02:40:12.000000000 +0200 @@ -139,8 +139,8 @@ copywin(const WINDOW *src, WINDOW *dst, { int sx, sy, dx, dy; bool touched; - attr_t bk = AttrOf(dst->_nc_bkgd); - attr_t mask = ~(attr_t) ((bk & A_COLOR) ? A_COLOR : 0); + attr_t bk; + attr_t mask; T((T_CALLED("copywin(%p, %p, %d, %d, %d, %d, %d, %d, %d)"), src, dst, sminrow, smincol, dminrow, dmincol, dmaxrow, dmaxcol, over)); @@ -148,6 +148,9 @@ copywin(const WINDOW *src, WINDOW *dst, if (!src || !dst) returnCode(ERR); + bk = AttrOf(dst->_nc_bkgd); + mask = ~(attr_t) ((bk & A_COLOR) ? A_COLOR : 0); + /* make sure rectangle exists in source */ if ((sminrow + dmaxrow - dminrow) > (src->_maxy + 1) || (smincol + dmaxcol - dmincol) > (src->_maxx + 1)) { --- ncurses/base/tries.c +++ ncurses/base/tries.c 2007-04-03 22:58:30.000000000 +0200 @@ -68,7 +68,7 @@ _nc_expand_try(TRIES * tree, unsigned co } } if (result != 0) { - if ((result[len] = ptr->ch) == 0) + if (ptr != 0 && (result[len] = ptr->ch) == 0) *((unsigned char *) (result + len)) = 128; #ifdef TRACE if (len == 0 && _nc_tracing != 0) --- ncurses/base/wresize.c +++ ncurses/base/wresize.c 2007-04-04 22:28:42.000000000 +0200 @@ -38,7 +38,7 @@ static int cleanup_lines(struct ldat *data, int length) { while (--length >= 0) - free(data->text); + free(data[length].text); free(data); return ERR; } --- ncurses/tinfo/trim_sgr0.c +++ ncurses/tinfo/trim_sgr0.c 2007-04-04 21:29:01.000000000 +0200 @@ -247,9 +247,7 @@ _nc_trim_sgr0(TERMTYPE *tp) if (!rewrite_sgr(on, enter_alt_charset_mode) || !rewrite_sgr(off, exit_alt_charset_mode) || !rewrite_sgr(end, exit_alt_charset_mode)) { - FreeIfNeeded(on); FreeIfNeeded(off); - FreeIfNeeded(end); } else if (similar_sgr(off, end) && !similar_sgr(off, on)) { TR(TRACE_DATABASE, ("adjusting sgr(9:off) : %s", _nc_visbuf(off))); @@ -315,8 +313,8 @@ _nc_trim_sgr0(TERMTYPE *tp) */ free(off); } - free(end); - free(on); + FreeIfNeeded(end); + FreeIfNeeded(on); } else { /* * Possibly some applications are confused if sgr0 contains rmacs, --- progs/dump_entry.c +++ progs/dump_entry.c 2007-04-07 17:51:47.000000000 +0200 @@ -352,14 +352,17 @@ version_filter(PredType type, PredIdx id } break; +#define is_termcap(type) (idx < (int) sizeof(type##_from_termcap) && \ + type##_from_termcap[idx]) + case V_BSD: /* BSD */ switch (type) { case BOOLEAN: - return bool_from_termcap[idx]; + return is_termcap(bool); case NUMBER: - return num_from_termcap[idx]; + return is_termcap(num); case STRING: - return str_from_termcap[idx]; + return is_termcap(str); } break; } @@ -788,11 +791,11 @@ fmt_entry(TERMTYPE *tterm, * Much more work should be done on this to support dumping termcaps. */ if (tversion == V_HPUX) { - if (memory_lock) { + if (VALID_STRING(memory_lock)) { (void) sprintf(buffer, "meml=%s", memory_lock); WRAP_CONCAT; } - if (memory_unlock) { + if (VALID_STRING(memory_unlock)) { (void) sprintf(buffer, "memu=%s", memory_unlock); WRAP_CONCAT; } --- progs/infocmp.c +++ progs/infocmp.c 2007-04-04 02:51:49.000000000 +0200 @@ -1084,7 +1084,6 @@ dump_initializers(TERMTYPE *term) } *tp++ = '"'; *tp = '\0'; - size += (strlen(term->Strings[n]) + 1); (void) printf("static char %-20s[] = %s;\n", string_variable(ExtStrname(term, n, strnames)), buf); } --- progs/tic.c +++ progs/tic.c 2007-04-07 17:20:35.000000000 +0200 @@ -353,11 +353,24 @@ open_input(const char *filename) return fp; } +#if NO_LEAKS +static void +free_namelist(char **src) +{ + if (src != 0) { + int n; + for (n = 0; src[n] != 0; ++n) + free (src[n]); + free (src); + } +} +#endif + /* Parse the "-e" option-value into a list of names */ -static const char ** +static char ** make_namelist(char *src) { - const char **dst = 0; + char **dst = 0; char *s, *base; unsigned pass, n, nn; @@ -374,11 +387,13 @@ make_namelist(char *src) if ((s = stripped(buffer)) != 0) { if (dst != 0) dst[nn] = s; + else + free(s); nn++; } } if (pass == 1) { - dst = typeCalloc(const char *, nn + 1); + dst = typeCalloc(char *, nn + 1); rewind(fp); } } @@ -401,10 +416,10 @@ make_namelist(char *src) break; } if (pass == 1) - dst = typeCalloc(const char *, nn + 1); + dst = typeCalloc(char *, nn + 1); } } - if (showsummary) { + if (showsummary && (dst != 0)) { fprintf(log_fp, "Entries that will be compiled:\n"); for (n = 0; dst[n] != 0; n++) fprintf(log_fp, "%u:%s\n", n + 1, dst[n]); @@ -413,7 +428,7 @@ make_namelist(char *src) } static bool -matches(const char **needle, const char *haystack) +matches(char **needle, const char *haystack) /* does entry in needle list match |-separated field in haystack? */ { bool code = FALSE; @@ -468,7 +483,7 @@ main(int argc, char *argv[]) bool limited = TRUE; char *tversion = (char *) NULL; const char *source_file = "terminfo"; - const char **namelst = 0; + char **namelst = 0; char *outdir = (char *) NULL; bool check_only = FALSE; bool suppress_untranslatable = FALSE; @@ -784,6 +799,9 @@ main(int argc, char *argv[]) else fprintf(log_fp, "No entries written\n"); } +#if NO_LEAKS + free_namelist(namelst); +#endif cleanup(); ExitProgram(EXIT_SUCCESS); } --- tack/ansi.c +++ tack/ansi.c 2007-04-07 16:49:53.000000000 +0200 @@ -309,6 +309,8 @@ request_cfss(void) put_crlf(); for (i = 0; rqss[i].text; i++) { ptext(rqss[i].text); + if (rqss[i].expect == 0) + continue; j = strlen(rqss[i].text) + strlen(rqss[i].expect); putchp(' '); for (j++; j < 40; j++) @@ -600,10 +602,11 @@ tools_status( i = read_reports(); if (i != 'r' && i != 'R') { *ch = i; - return; + break; } } while (i); + /* VT320, VT420, etc. */ if (terminal_class >= 63) { do { i = request_cfss(); @@ -841,7 +844,7 @@ tools_charset( bank[j] = ch; if (ch < ' ' || ch > '/') break; - if (j + 1 >= (int) sizeof(bank)) + if (j + 2 >= (int) sizeof(bank)) break; } if (j == 1) --- tack/output.c +++ tack/output.c 2007-04-07 16:39:05.000000000 +0200 @@ -740,7 +740,9 @@ wait_here(void) /* ignore control S, but tell me about it */ while (ch == 023 || ch == 021) { ch = getchp(STRIP_PARITY); - if (i < (int) sizeof(cc)) + if (ch == EOF) + break; + if (i + 1 < (int) sizeof(cc)) cc[++i] = ch; } put_str("\nThe terminal sent a ^S -"); @@ -778,7 +780,7 @@ read_string( for (i = 0; i < length - 1; ) { ch = getchp(STRIP_PARITY); - if (ch == '\r' || ch == '\n') { + if (ch == '\r' || ch == '\n' || ch == EOF) { break; } if (ch == '\b' || ch == 127) { --- test/bs.c +++ test/bs.c 2007-04-03 01:14:05.000000000 +0200 @@ -459,7 +459,7 @@ initgame(void) do { c = getch(); } while - (!strchr("hjklrR", c) || c == FF); + (!(strchr("hjklrR", c) || c == FF)); if (c == FF) { (void) clearok(stdscr, TRUE); --- test/cardfile.c +++ test/cardfile.c 2007-04-04 22:12:24.000000000 +0200 @@ -136,13 +136,15 @@ add_content(CARD * card, const char *con if ((offset = strlen(card->content)) != 0) { total += 1 + offset; card->content = (char *) realloc(card->content, total + 1); - strcpy(card->content + offset++, " "); + if (card->content) + strcpy(card->content + offset++, " "); } else { if (card->content != 0) free(card->content); card->content = (char *) malloc(total + 1); } - strcpy(card->content + offset, content); + if (card->content) + strcpy(card->content + offset, content); } } --- test/demo_defkey.c +++ test/demo_defkey.c 2007-04-03 01:17:56.000000000 +0200 @@ -143,13 +143,12 @@ really_define_key(WINDOW *win, const cha code_name); } log_last_line(win); + if (vis_string != 0) { free(vis_string); vis_string = 0; } - if (vis_string != 0) - free(vis_string); vis_string = visible(new_string); if ((rc = key_defined(new_string)) > 0) { wprintw(win, "%s was bound to %s\n", vis_string, keyname(rc)); ++++++ ncurses-5.6.dif ++++++ --- /var/tmp/diff_new_pack.G29552/_old 2008-04-09 21:36:49.000000000 +0200 +++ /var/tmp/diff_new_pack.G29552/_new 2008-04-09 21:36:49.000000000 +0200 @@ -1,9 +1,11 @@ --- .pkgextract +++ .pkgextract 2006-05-18 16:07:14.000000000 +0200 -@@ -0,0 +1,3 @@ +@@ -0,0 +1,5 @@ +tar Oxfj ../ncurses-5.6-20070128-patch.tar.bz2 | patch -p1 -s +patch -p0 -s --suffix=.va < ../ncurses-5.3-printw.dif +patch -p0 -s --suffix=.pt < ../ncurses-5.6-pthread.dif ++patch -p0 -s --suffix=.ov < ../ncurses-5.6-overwrite.dif ++patch -p0 -s --suffix=.cv < ../ncurses-5.6-coverity.patch --- aclocal.m4 +++ aclocal.m4 2007-01-31 13:28:46.000000000 +0100 @@ -298,7 +298,7 @@ AC_MSG_CHECKING([for size of bool]) @@ -259,44 +261,9 @@ else TINFO_ARGS="-L${LIB_DIR} -l${LIB_NAME}${DFT_ARG_SUFFIX}" fi ---- form/Makefile.in -+++ form/Makefile.in 2006-05-18 16:07:15.000000000 +0200 -@@ -81,7 +81,7 @@ CFLAGS = @CFLAGS@ - - CPPFLAGS = -I@top_srcdir@/ncurses -DHAVE_CONFIG_H @CPPFLAGS@ - --CCFLAGS = $(CPPFLAGS) $(CFLAGS) -+CCFLAGS = $(CPPFLAGS) $(CFLAGS) -D_REENTRANT - - CFLAGS_LIBTOOL = $(CCFLAGS) - CFLAGS_NORMAL = $(CCFLAGS) ---- include/Makefile.in -+++ include/Makefile.in 2006-05-18 16:07:15.000000000 +0200 -@@ -88,7 +88,7 @@ curses.h : $(TERMINFO_CAPS) \ - $(srcdir)/MKkey_defs.sh - cat curses.head >$@ - AWK=$(AWK) sh $(srcdir)/MKkey_defs.sh $(TERMINFO_CAPS) >>$@ -- sh -c 'if test "@NCURSES_CH_T@" = "cchar_t" ; then cat $(srcdir)/curses.wide >>$@ ; fi' -+ cat $(srcdir)/curses.wide >>$@ - cat $(srcdir)/curses.tail >>$@ - - term.h: $(TERMINFO_CAPS) MKterm.h.awk --- include/curses.h.in +++ include/curses.h.in 2006-05-18 16:07:15.000000000 +0200 -@@ -120,7 +120,11 @@ - * of the header incompatible. - */ - #undef NCURSES_CH_T --#define NCURSES_CH_T @NCURSES_CH_T@ -+#ifdef _XOPEN_SOURCE_EXTENDED -+#define NCURSES_CH_T cchar_t -+#else -+#define NCURSES_CH_T chtype -+#endif - - #if @cf_cv_enable_lp64@ && defined(_LP64) - typedef unsigned chtype; -@@ -130,6 +134,8 @@ typedef unsigned @cf_cv_typeof_chtype@ c +@@ -130,6 +130,8 @@ typedef unsigned @cf_cv_typeof_chtype@ c typedef unsigned @cf_cv_typeof_mmask_t@ mmask_t; #endif @@ -305,26 +272,6 @@ #include <stdio.h> #include <unctrl.h> #include <stdarg.h> /* we need va_list */ -@@ -328,16 +334,16 @@ typedef chtype attr_t; /* ...must be at - #include <libutf8.h> - #endif - --#if @NEED_WCHAR_H@ -+#if 1 - #include <wchar.h> /* ...to get mbstate_t, etc. */ - #endif - - #if @NCURSES_WCHAR_T@ --typedef unsigned short wchar_t@NCURSES_OK_WCHAR_T@; -+typedef unsigned short wchar_t; - #endif - - #if @NCURSES_WINT_T@ --typedef unsigned int wint_t@NCURSES_OK_WCHAR_T@; -+typedef unsigned int wint_t; - #endif - - #define CCHARW_MAX 5 --- include/termcap.h.in +++ include/termcap.h.in 2006-05-18 16:07:15.000000000 +0200 @@ -46,6 +46,8 @@ extern "C" @@ -377,17 +324,6 @@ The \fBncurses\fR library permits manipulation of data structures, called \fIwindows\fR, which can be thought of as two-dimensional arrays of characters representing all or part of a CRT screen. A ---- menu/Makefile.in -+++ menu/Makefile.in 2006-05-18 16:07:15.000000000 +0200 -@@ -81,7 +81,7 @@ CFLAGS = @CFLAGS@ - - CPPFLAGS = -I@top_srcdir@/ncurses -DHAVE_CONFIG_H @CPPFLAGS@ - --CCFLAGS = $(CPPFLAGS) $(CFLAGS) -+CCFLAGS = $(CPPFLAGS) $(CFLAGS) -D_REENTRANT - - CFLAGS_LIBTOOL = $(CCFLAGS) - CFLAGS_NORMAL = $(CCFLAGS) --- misc/terminfo.src +++ misc/terminfo.src 2007-01-31 14:27:30.000000000 +0100 @@ -301,7 +301,9 @@ dumb|80-column dumb tty, @@ -747,15 +683,6 @@ ibm5081-c|ibmmpel-c|IBM 5081 1024x1024 256/4096 Megapel enhanced color display, --- ncurses/Makefile.in +++ ncurses/Makefile.in 2007-01-31 13:34:38.000000000 +0100 -@@ -90,7 +90,7 @@ CFLAGS = @CFLAGS@ - INCDIR = $(srcdir)/../include - CPPFLAGS = -DHAVE_CONFIG_H -I../ncurses -I$(srcdir) @CPPFLAGS@ - --CCFLAGS = $(CPPFLAGS) $(CFLAGS) -+CCFLAGS = $(CPPFLAGS) $(CFLAGS) -D_REENTRANT - - BUILD_CPPFLAGS = -I../include @BUILD_CPPFLAGS@ - BUILD_CC = @BUILD_CC@ @@ -184,7 +184,7 @@ $(DESTDIR)$(libdir) : ../lib : ; mkdir $@ @@ -943,17 +870,6 @@ } } if (copied != 0) ---- panel/Makefile.in -+++ panel/Makefile.in 2006-05-18 16:07:15.000000000 +0200 -@@ -82,7 +82,7 @@ CFLAGS = @CFLAGS@ - - CPPFLAGS = -I@top_srcdir@/ncurses -DHAVE_CONFIG_H @CPPFLAGS@ - --CCFLAGS = $(CPPFLAGS) $(CFLAGS) -+CCFLAGS = $(CPPFLAGS) $(CFLAGS) -D_REENTRANT - - CFLAGS_LIBTOOL = $(CCFLAGS) - CFLAGS_NORMAL = $(CCFLAGS) --- test/test.priv.h +++ test/test.priv.h 2006-05-18 16:07:19.000000000 +0200 @@ -429,12 +429,12 @@ extern int optind; ++++++ ncurses-5.6-pthread.dif ++++++ --- /var/tmp/diff_new_pack.G29552/_old 2008-04-09 21:36:49.000000000 +0200 +++ /var/tmp/diff_new_pack.G29552/_new 2008-04-09 21:36:49.000000000 +0200 @@ -29,7 +29,7 @@ + +static inline int _nc__sigprocmask(int how, const sigset_t *newmask, sigset_t *oldmask) +{ -+ if (&pthread_sigmask) ++ if ((pthread_sigmask)) + return pthread_sigmask(how, newmask, oldmask); + else + return sigprocmask(how, newmask, oldmask); @@ -41,7 +41,7 @@ +{ + if (!scan || !scan->_read_thread) + goto out; -+ if (!&pthread_kill || !&pthread_equal || !&pthread_self) ++ if (!(pthread_kill) || !(pthread_equal) || !(pthread_self)) + goto out; + if (pthread_equal(scan->_read_thread, pthread_self())) + goto out; @@ -67,7 +67,7 @@ #ifdef __cplusplus extern "C" { #endif -@@ -594,6 +598,11 @@ struct screen { +@@ -591,6 +595,11 @@ struct screen { #define _nc_windows SP->_nc_sp_windows bool _sig_winch; @@ -79,7 +79,7 @@ SCREEN *_next_screen; /* hashes for old and new lines */ -@@ -1214,6 +1223,9 @@ extern NCURSES_EXPORT(void) _nc_scroll_o +@@ -1209,6 +1218,9 @@ extern NCURSES_EXPORT(void) _nc_scroll_o extern NCURSES_EXPORT(void) _nc_scroll_optimize (void); extern NCURSES_EXPORT(void) _nc_set_buffer (FILE *, bool); extern NCURSES_EXPORT(void) _nc_signal_handler (bool); @@ -87,7 +87,7 @@ +extern NCURSES_EXPORT(void) _nc_thread(SCREEN *); +#endif extern NCURSES_EXPORT(void) _nc_synchook (WINDOW *); - extern NCURSES_EXPORT(void) _nc_trace_tries (TRIES *); + extern NCURSES_EXPORT(void) _nc_trace_tries (struct tries *); --- ncurses/base/lib_getch.c +++ ncurses/base/lib_getch.c 2007-01-31 12:41:27.000000000 +0100 @@ -103,7 +103,16 @@ if (wgetch_should_refresh(win)) wrefresh(win); --- ncurses/base/lib_set_term.c -+++ ncurses/base/lib_set_term.c 2007-01-31 13:08:37.000000000 +0100 ++++ ncurses/base/lib_set_term.c 2008-04-08 15:18:15.230819462 +0200 +@@ -40,7 +40,7 @@ + */ + + #include <curses.priv.h> +- ++#include <SigAction.h> + #include <term.h> /* cur_term */ + #include <tic.h> + @@ -144,6 +144,12 @@ delscreen(SCREEN *sp) free(sp->_setbuf); } @@ -123,7 +132,7 @@ +#if USE_SIGWINCH +# if defined(linux) && (defined(_REENTRANT) || defined(_THREAD_SAFE)) -+ if (&pthread_self) ++ if ((pthread_self)) + SP->_read_thread = pthread_self(); + else + SP->_read_thread = (pthread_t)0; @@ -200,7 +209,7 @@ CatchIfDefault(SIGTERM, cleanup); #if USE_SIGWINCH +# if defined(linux) && (defined(_REENTRANT) || defined(_THREAD_SAFE)) -+ if (&pthread_self && &pthread_equal) { ++ if ((pthread_self) && (pthread_equal)) { + pthread_t current = pthread_self(); + if (!pthread_equal(SP->_read_thread, current)) + SP->_read_thread = current; @@ -225,7 +234,7 @@ +_nc_thread(SCREEN *scan) +{ +# if defined(linux) && (defined(_REENTRANT) || defined(_THREAD_SAFE)) -+ if (&pthread_self && &pthread_equal) { ++ if ((pthread_self) && (pthread_equal)) { + pthread_t current = pthread_self(); + if (pthread_equal(SP->_read_thread, current)) + return; ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Remember to have fun... --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-commit+help@opensuse.org