From 68029095b5b1fe1eb7033b300917d149882d72c2 Mon Sep 17 00:00:00 2001 From: David Adam Date: Mon, 8 Dec 2014 07:54:33 +0800 Subject: [PATCH] Remove del_curterm workaround on *BSD. FreeBSD PR was https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=108117 OpenBSD PR was 5447. Both have been fixed for years. This reverts commit c55cbd3f2f003ea6e36727f8b985e880d6aded85, among others. --- configure.ac | 19 ------------------- fallback.h | 9 --------- input.cpp | 2 +- 3 files changed, 1 insertion(+), 29 deletions(-) diff --git a/configure.ac b/configure.ac index f0d555f04..6c0e32e92 100644 --- a/configure.ac +++ b/configure.ac @@ -748,25 +748,6 @@ else AC_MSG_RESULT(no) fi -# Check if del_curterm is broken - in that case we redefine -# del_curterm as a no-op, to avoid a double-free - -AC_MSG_CHECKING([If del_curterm is broken]) -case $target_os in - *bsd*) - AC_MSG_RESULT(yes) - AC_DEFINE( - [HAVE_BROKEN_DEL_CURTERM], - [1], - [del_curterm is broken, redefine it to a no-op to avoid a double-free bug] - ) - ;; - *) - AC_MSG_RESULT(no) - ;; -esac - - # Tell the world what we know AC_CONFIG_FILES([Makefile]) AC_OUTPUT diff --git a/fallback.h b/fallback.h index eba91be6c..7d3afa13b 100644 --- a/fallback.h +++ b/fallback.h @@ -348,15 +348,6 @@ size_t wcslcpy(wchar_t *dst, const wchar_t *src, size_t siz); #endif -/** - BSD del_curterm seems to do a double-free. We redefine it as a no-op -*/ -#ifdef HAVE_BROKEN_DEL_CURTERM -#define fish_del_curterm(X) OK -#else -#define fish_del_curterm(X) del_curterm(X) -#endif - #ifndef HAVE_LRAND48_R /** diff --git a/input.cpp b/input.cpp index 136c68c5f..8eeb44779 100644 --- a/input.cpp +++ b/input.cpp @@ -528,7 +528,7 @@ void input_destroy() input_common_destroy(); - if (fish_del_curterm(cur_term) == ERR) + if (del_curterm(cur_term) == ERR) { debug(0, _(L"Error while closing terminfo")); }