rc

[fork] interactive rc shell
Log | Files | Refs | README | LICENSE

commit 75b4f0440f1e83b020e17b0d09dafe37dbf7e4ee
parent 769ce647bc9079b54d745d4e56c790622aff0d57
Author: tgoodwin <tgoodwin>
Date:   Mon, 13 Jul 1998 10:22:06 +0000

add READLINE_OLD

Diffstat:
Macconfig.h | 3+++
Mconfigure.ac | 19++++++++++++++-----
Msignal.c | 8+++++++-
3 files changed, 24 insertions(+), 6 deletions(-)

diff --git a/acconfig.h b/acconfig.h @@ -52,6 +52,9 @@ /* Define if you want to use GNU readline. */ #undef READLINE +/* Define if you have the older readline, with rl_deprep_terminal. */ +#undef READLINE_OLD + /* Define if RLIMIT_foo defines need _KERNEL. */ #undef RLIMIT_NEEDS_KERNEL diff --git a/configure.ac b/configure.ac @@ -290,12 +290,21 @@ AC_ARG_WITH(editline, [ --with-editline Simmule Turner's line editing], AC_DEFINE(EDITLINE) LIBS="$LIBS -ledit", AC_MSG_WARN(editline library not found))) -AC_ARG_WITH(readline, [ --with-readline Bloated GNU line editing], - AC_CHECK_LIB(readline, readline, [ +dnl Getting readline right is hard. There are (at least) two incompatible versions, +dnl and we need to know which one we are using. There are also two different +dnl names for the include files. +AC_ARG_WITH(readline, [ --with-readline Bloated GNU line editing], [ + AC_CHECK_LIB(readline, rl_deprep_terminal, [ + AC_DEFINE(READLINE) + AC_DEFINE(READLINE_OLD) + ], [ + AC_CHECK_LIB(readline, readline, [ AC_DEFINE(READLINE) - LIBS="$LIBS -lreadline -ltermcap" - AC_CHECK_HEADERS(readline.h readline/readline.h) - ], AC_MSG_WARN(readline library not found), -ltermcap)) + ], AC_MSG_WARN(readline library not found), -ltermcap) + ], -ltermcap) + LIBS="$LIBS -lreadline -ltermcap" + AC_CHECK_HEADERS(readline.h readline/readline.h) +]) AM_CONDITIONAL(AMC_READLINE, test "${with_readline+set}" = set) AC_OUTPUT(Makefile) diff --git a/signal.c b/signal.c @@ -28,10 +28,16 @@ extern void catcher(int s) { in_readline = FALSE; switch (s) { extern int rl_pending_input; - + extern VFunction *rl_deprep_term_function; + default: +#if READLINE_OLD rl_clean_up_for_exit(); rl_deprep_terminal(); +#else + _rl_clean_up_for_exit(); + (*rl_deprep_term_function)(); +#endif rl_clear_signals(); rl_pending_input = 0; break;