diff options
author | joerg <joerg@pkgsrc.org> | 2015-12-11 19:23:22 +0000 |
---|---|---|
committer | joerg <joerg@pkgsrc.org> | 2015-12-11 19:23:22 +0000 |
commit | 645b734ea79133bb4dc586754f1c676ce9b021d2 (patch) | |
tree | 871dbcf0bf7997116dcff02b4665b4a255f08719 /devel | |
parent | 06c14f2c6badb8089d4af80d8dfaf5c1aebba277 (diff) | |
download | pkgsrc-645b734ea79133bb4dc586754f1c676ce9b021d2.tar.gz |
initscr is supposed to return NULL on error. Some versions of ncurses at
least like to play nanny and error out internally, but catch those
errors explicitly. Stops segfault when using NetBSD curses with invalid
TERM settings.
Diffstat (limited to 'devel')
-rw-r--r-- | devel/cmake/distinfo | 3 | ||||
-rw-r--r-- | devel/cmake/patches/patch-Source_CursesDialog_ccmake.cxx | 29 |
2 files changed, 31 insertions, 1 deletions
diff --git a/devel/cmake/distinfo b/devel/cmake/distinfo index 85da8ff5765..4d8392d5739 100644 --- a/devel/cmake/distinfo +++ b/devel/cmake/distinfo @@ -1,4 +1,4 @@ -$NetBSD: distinfo,v 1.82 2015/12/07 09:30:32 adam Exp $ +$NetBSD: distinfo,v 1.83 2015/12/11 19:23:22 joerg Exp $ SHA1 (cmake-3.4.1.tar.gz) = 345258f3fdb8609e5c021c1d70490010ae3cb9bc RMD160 (cmake-3.4.1.tar.gz) = b50b982f0f60a0f52c70527691a42cd5718b2ceb @@ -7,6 +7,7 @@ Size (cmake-3.4.1.tar.gz) = 6721965 bytes SHA1 (patch-CMakeLists.txt) = ae722c41e0d9a1396fe80f1000266a33e406e2f6 SHA1 (patch-Modules_FindX11.cmake) = 124a2d51155cb4455e8b829dc74598cbd50a4e1c SHA1 (patch-Modules_Platform_SCO__SV.cmake) = 3ed230b3a06ea693812db8f57bc73aebec12b99f +SHA1 (patch-Source_CursesDialog_ccmake.cxx) = c77cf55df2b047908178e7ed1db6e5454834ea49 SHA1 (patch-Source_cmELF.cxx) = 5eb9dc0b3567b5685596ddf0a03ca8e5c76e6f92 SHA1 (patch-Source_kwsys_SystemInformation.cxx) = 5e8c8ff7875c329e48c54ee03570ea4a6d52953a SHA1 (patch-Source_kwsys_SystemTools.cxx) = 634348b9bc8ccf8c72f23837baa6ba0bcacf5961 diff --git a/devel/cmake/patches/patch-Source_CursesDialog_ccmake.cxx b/devel/cmake/patches/patch-Source_CursesDialog_ccmake.cxx new file mode 100644 index 00000000000..ed193e84fe6 --- /dev/null +++ b/devel/cmake/patches/patch-Source_CursesDialog_ccmake.cxx @@ -0,0 +1,29 @@ +$NetBSD: patch-Source_CursesDialog_ccmake.cxx,v 1.1 2015/12/11 19:23:22 joerg Exp $ + +--- Source/CursesDialog/ccmake.cxx.orig 2015-12-02 15:43:21.000000000 +0000 ++++ Source/CursesDialog/ccmake.cxx +@@ -68,7 +68,11 @@ void onsig(int) + if (cmCursesForm::CurrentForm) + { + endwin(); +- initscr(); /* Initialization */ ++ if (initscr() == NULL) { ++ static const char errmsg[] = "terminal setup failed\n"; ++ write(STDERR_FILENO, errmsg, sizeof(errmsg) - 1); ++ exit (1); ++ } + noecho(); /* Echo off */ + cbreak(); /* nl- or cr not needed */ + keypad(stdscr,TRUE); /* Use key symbols as +@@ -154,7 +158,10 @@ int main(int argc, char const* const* ar + cmCursesForm::DebugStart(); + } + +- initscr(); /* Initialization */ ++ if (initscr() == NULL) { ++ fprintf(stderr, "terminal setup failed\n"); ++ exit (1); ++ } + noecho(); /* Echo off */ + cbreak(); /* nl- or cr not needed */ + keypad(stdscr,TRUE); /* Use key symbols as |