From: Chet Ramey Date: Mon, 29 Aug 2016 15:02:02 +0000 (-0400) Subject: commit readline-20160829 snapshot X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2d25ad6f2c6c8842920b8b22dc33169334881e1b;p=thirdparty%2Freadline.git commit readline-20160829 snapshot --- diff --git a/CHANGES b/CHANGES index 1291439..b5e16b7 100644 --- a/CHANGES +++ b/CHANGES @@ -106,8 +106,8 @@ hh. Fixed an issue that caused completion of git commands to display ii. Fixed several redisplay bugs having to do with multibyte characters and invisible characters in prompt strings. -jj. Fixed a bug that caused mode strings to be displayed incorrectly if the prompt was - shorter than the mode string. +jj. Fixed a bug that caused mode strings to be displayed incorrectly if the + prompt was shorter than the mode string. 2. New Features in Readline @@ -176,10 +176,11 @@ r. The :p history modifier now applies to the entire line, so any expansion s. New application-callable function: rl_pending_signal(): returns the signal number of any signal readline has caught but not yet handled. -t. New application-settable variable: rl_persistent_signal_handlers: if set to a - non-zero value, readline will enable the readline-6.2 signal handler behavior - in callback mode: handlers are installed when rl_callback_handler_install is - called and removed removed when a complete line has been read. +t. New application-settable variable: rl_persistent_signal_handlers: if set + to a non-zero value, readline will enable the readline-6.2 signal handler + behavior in callback mode: handlers are installed when + rl_callback_handler_install is called and removed removed when a complete + line has been read. ------------------------------------------------------------------------------- This document details the changes between this version, readline-6.3, and the diff --git a/CHANGES-7.0 b/CHANGES-7.0 index 36694cb..1d14b5d 100644 --- a/CHANGES-7.0 +++ b/CHANGES-7.0 @@ -106,8 +106,8 @@ hh. Fixed an issue that caused completion of git commands to display ii. Fixed several redisplay bugs having to do with multibyte characters and invisible characters in prompt strings. -jj. Fixed a bug that caused mode strings to be displayed incorrectly if the prompt was - shorter than the mode string. +jj. Fixed a bug that caused mode strings to be displayed incorrectly if the + prompt was shorter than the mode string. 2. New Features in Readline @@ -154,6 +154,7 @@ k. If readline reads a history file that begins with `#' (or the value of l. Readline now throws an error if it parses a key binding without a terminating `:' or whitespace. + m. The default binding for ^W in vi mode now uses word boundaries specified by Posix (vi-unix-word-rubout is bindable command name). @@ -176,7 +177,8 @@ r. The :p history modifier now applies to the entire line, so any expansion s. New application-callable function: rl_pending_signal(): returns the signal number of any signal readline has caught but not yet handled. -t. New application-settable variable: rl_persistent_signal_handlers: if set to a - non-zero value, readline will enable the readline-6.2 signal handler behavior - in callback mode: handlers are installed when rl_callback_handler_install is - called and removed removed when a complete line has been read. +t. New application-settable variable: rl_persistent_signal_handlers: if set + to a non-zero value, readline will enable the readline-6.2 signal handler + behavior in callback mode: handlers are installed when + rl_callback_handler_install is called and removed removed when a complete + line has been read. diff --git a/histexpand.c b/histexpand.c index 46a99aa..b84a6b8 100644 --- a/histexpand.c +++ b/histexpand.c @@ -44,6 +44,7 @@ #include "history.h" #include "histlib.h" +#include "chardefs.h" #include "rlshell.h" #include "xmalloc.h" @@ -1433,10 +1434,10 @@ history_tokenize_word (string, ind) return i; } - if (isdigit (string[i])) + if (ISDIGIT (string[i])) { j = i; - while (string[j] && isdigit (string[j])) + while (string[j] && ISDIGIT (string[j])) j++; if (string[j] == 0) return (j); @@ -1465,7 +1466,7 @@ history_tokenize_word (string, ind) else if (peek == '&' && (string[i] == '>' || string[i] == '<')) { j = i + 2; - while (string[j] && isdigit (string[j])) /* file descriptor */ + while (string[j] && ISDIGIT (string[j])) /* file descriptor */ j++; if (string[j] =='-') /* <&[digits]-, >&[digits]- */ j++; diff --git a/input.c b/input.c index 84faf5a..ce86853 100644 --- a/input.c +++ b/input.c @@ -567,10 +567,18 @@ handle_error: if (errno != EINTR) return (RL_ISSTATE (RL_STATE_READCMD) ? READERR : EOF); /* fatal signals of interest */ +#if defined (SIGHUP) else if (_rl_caught_signal == SIGHUP || _rl_caught_signal == SIGTERM) +#else + else if (_rl_caught_signal == SIGTERM) +#endif return (RL_ISSTATE (RL_STATE_READCMD) ? READERR : EOF); /* keyboard-generated signals of interest */ +#if defined (SIGQUIT) else if (_rl_caught_signal == SIGINT || _rl_caught_signal == SIGQUIT) +#else + else if (_rl_caught_signal == SIGINT) +#endif RL_CHECK_SIGNALS (); /* non-keyboard-generated signals of interest */ else if (_rl_caught_signal == SIGWINCH) diff --git a/signals.c b/signals.c index 0b8dda4..927f532 100644 --- a/signals.c +++ b/signals.c @@ -235,7 +235,9 @@ _rl_handle_signal (sig) case SIGTTOU: #endif /* SIGTSTP */ case SIGTERM: +#if defined (SIGHUP) case SIGHUP: +#endif #if defined (SIGALRM) case SIGALRM: #endif @@ -415,7 +417,9 @@ rl_set_signals () sigaddset (&bset, SIGINT); sigaddset (&bset, SIGTERM); +#if defined (SIGHUP) sigaddset (&bset, SIGHUP); +#endif #if defined (SIGQUIT) sigaddset (&bset, SIGQUIT); #endif @@ -444,7 +448,9 @@ rl_set_signals () rl_maybe_set_sighandler (SIGINT, rl_signal_handler, &old_int); rl_maybe_set_sighandler (SIGTERM, rl_signal_handler, &old_term); +#if defined (SIGHUP) rl_maybe_set_sighandler (SIGHUP, rl_signal_handler, &old_hup); +#endif #if defined (SIGQUIT) rl_maybe_set_sighandler (SIGQUIT, rl_signal_handler, &old_quit); #endif @@ -509,7 +515,9 @@ rl_clear_signals () overhead */ rl_maybe_restore_sighandler (SIGINT, &old_int); rl_maybe_restore_sighandler (SIGTERM, &old_term); +#if defined (SIGHUP) rl_maybe_restore_sighandler (SIGHUP, &old_hup); +#endif #if defined (SIGQUIT) rl_maybe_restore_sighandler (SIGQUIT, &old_quit); #endif