From: Chet Ramey Date: Mon, 10 Jul 2017 19:15:57 +0000 (-0400) Subject: commit readline-20170710 snapshot X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7d5c55360e97d867c60d64374c9bc5547e26fb1b;p=thirdparty%2Freadline.git commit readline-20170710 snapshot --- diff --git a/complete.c b/complete.c index 662a19d..adce0d6 100644 --- a/complete.c +++ b/complete.c @@ -804,6 +804,8 @@ fnprint (const char *to_print, int prefix_bytes, const char *real_pathname) print_len = strlen (to_print); end = to_print + print_len + 1; memset (&ps, 0, sizeof (mbstate_t)); +#else + print_len = strlen (to_print); #endif printed_len = common_prefix_len = 0; diff --git a/doc/rluser.texi b/doc/rluser.texi index 22bbd1e..95de21b 100644 --- a/doc/rluser.texi +++ b/doc/rluser.texi @@ -1732,8 +1732,9 @@ A synonym for @code{yank-last-arg}. @item operate-and-get-next (C-o) Accept the current line for execution and fetch the next line -relative to the current line from the history for editing. Any -argument is ignored. +relative to the current line from the history for editing. +A numeric argument, if supplied, specifies the history entry to use instead +of the current line. @item edit-and-execute-command (C-x C-e) Invoke an editor on the current command line, and execute the result as shell diff --git a/doc/version.texi b/doc/version.texi index fac7b5e..9eb9e75 100644 --- a/doc/version.texi +++ b/doc/version.texi @@ -4,7 +4,7 @@ Copyright (C) 1988-2017 Free Software Foundation, Inc. @set EDITION 7.0 @set VERSION 7.0 -@set UPDATED 21 April 2017 -@set UPDATED-MONTH April 2017 +@set UPDATED 4 July 2017 +@set UPDATED-MONTH July 2017 -@set LASTCHANGE Fri Apr 21 15:25:17 EDT 2017 +@set LASTCHANGE Tue Jul 4 16:32:48 EDT 2017 diff --git a/misc.c b/misc.c index 716586c..64b1457 100644 --- a/misc.c +++ b/misc.c @@ -275,6 +275,8 @@ _rl_arg_callback (_rl_arg_cxt cxt) } r = _rl_arg_dispatch (cxt, c); + if (r > 0) + rl_message ("(arg: %d) ", rl_arg_sign * rl_numeric_arg); return (r != 1); } diff --git a/signals.c b/signals.c index fcf45b7..add165c 100644 --- a/signals.c +++ b/signals.c @@ -249,9 +249,11 @@ _rl_handle_signal (int sig) rl_cleanup_after_signal (); #if defined (HAVE_POSIX_SIGNALS) +# if defined (SIGTSTP) /* Unblock SIGTTOU blocked above */ if (sig == SIGTTIN || sig == SIGTSTP) sigprocmask (SIG_UNBLOCK, &set, (sigset_t *)NULL); +# endif sigemptyset (&set); sigprocmask (SIG_BLOCK, (sigset_t *)NULL, &set); diff --git a/text.c b/text.c index 86a13b1..116a33b 100644 --- a/text.c +++ b/text.c @@ -980,14 +980,29 @@ _rl_insert_next (int count) static int _rl_insert_next_callback (_rl_callback_generic_arg *data) { - int count; + int count, r; count = data->count; + r = 0; + + if (count < 0) + { + data->count++; + r = _rl_insert_next (1); + _rl_want_redisplay = 1; + /* If we should keep going, leave the callback function installed */ + if (data->count < 0 && r == 0) + return r; + count = 0; /* data->count == 0 || r != 0; force break below */ + } /* Deregister function, let rl_callback_read_char deallocate data */ _rl_callback_func = 0; _rl_want_redisplay = 1; - + + if (count == 0) + return r; + return _rl_insert_next (count); } #endif @@ -1009,7 +1024,18 @@ rl_quoted_insert (int count, int key) return (0); } #endif - + + /* A negative count means to quote the next -COUNT characters. */ + if (count < 0) + { + int r; + + do + r = _rl_insert_next (1); + while (r == 0 && ++count < 0); + return r; + } + return _rl_insert_next (count); }