Makefile.in,examples/Makefile.in
- add support for building with address sanitizer, using new target
`asan'
+
+ 4/23/2018
+ ---------
+configure.ac
+ - TERMCAP_PKG_CONFIG_LIB: new variable, defined from TERMCAP_LIB,
+ defaults to termcap
+
+readline.pc.in
+ - change Requires.private to use TERMCAP_PKG_CONFIG_LIB instead of
+ hardcoded `tinfo'. Report and fix from Thomas Petazzoni
+ <thomas.petazzoni@bootlin.com>
AC_DEFUN(BASH_CHECK_DEV_STDIN,
[AC_MSG_CHECKING(whether /dev/stdin stdout stderr are available)
AC_CACHE_VAL(bash_cv_dev_stdin,
-[if test -d /dev/fd && (exec test -r /dev/stdin < /dev/null) ; then
- bash_cv_dev_stdin=present
- elif test -d /proc/self/fd && (exec test -r /dev/stdin < /dev/null) ; then
+[if (exec test -r /dev/stdin < /dev/null) ; then
bash_cv_dev_stdin=present
else
bash_cv_dev_stdin=absent
static void _rl_init_file_error ();
#endif
+static rl_command_func_t *_rl_function_of_keyseq_internal PARAMS((const char *, size_t, Keymap, int *));
+
static char *_rl_read_file PARAMS((char *, size_t *));
static int _rl_read_init_file PARAMS((const char *, int));
static int glean_key_from_name PARAMS((char *));
int
rl_bind_key_if_unbound_in_map (int key, rl_command_func_t *default_func, Keymap kmap)
{
- char keyseq[2];
+ char *keyseq;
- keyseq[0] = (unsigned char)key;
- keyseq[1] = '\0';
+ keyseq = rl_untranslate_keyseq ((unsigned char)key);
return (rl_bind_keyseq_if_unbound_in_map (keyseq, default_func, kmap));
}
int
rl_bind_key_if_unbound (int key, rl_command_func_t *default_func)
{
- char keyseq[2];
+ char *keyseq;
- keyseq[0] = (unsigned char)key;
- keyseq[1] = '\0';
+ keyseq = rl_untranslate_keyseq ((unsigned char)key);
return (rl_bind_keyseq_if_unbound_in_map (keyseq, default_func, _rl_keymap));
}
rl_bind_keyseq_if_unbound_in_map (const char *keyseq, rl_command_func_t *default_func, Keymap kmap)
{
rl_command_func_t *func;
+ char *keys;
+ int keys_len;
if (keyseq)
{
- func = rl_function_of_keyseq (keyseq, kmap, (int *)NULL);
+ /* Handle key sequences that require translations and `raw' ones that
+ don't. This might be a problem with backslashes. */
+ keys = (char *)xmalloc (1 + (2 * strlen (keyseq)));
+ if (rl_translate_keyseq (keyseq, keys, &keys_len))
+ {
+ xfree (keys);
+ return -1;
+ }
+ func = rl_function_of_keyseq_len (keys, keys_len, kmap, (int *)NULL);
+ xfree (keys);
#if defined (VI_MODE)
if (!func || func == rl_do_lowercase_version || func == rl_vi_movement_mode)
#else
unsigned char uc = keys[i];
int ic;
- prevkey = ic;
+ if (i > 0)
+ prevkey = ic;
ic = uc;
if (ic < 0 || ic >= KEYMAP_SIZE)
used. TYPE, if non-NULL, is a pointer to an int which will receive the
type of the object pointed to. One of ISFUNC (function), ISKMAP (keymap),
or ISMACR (macro). */
-rl_command_func_t *
-rl_function_of_keyseq (const char *keyseq, Keymap map, int *type)
+static rl_command_func_t *
+_rl_function_of_keyseq_internal (const char *keyseq, size_t len, Keymap map, int *type)
{
register int i;
if (map == 0)
map = _rl_keymap;
- for (i = 0; keyseq && keyseq[i]; i++)
+ for (i = 0; keyseq && i < len; i++)
{
unsigned char ic = keyseq[i];
return ((rl_command_func_t *) NULL);
}
+rl_command_func_t *
+rl_function_of_keyseq (const char *keyseq, Keymap map, int *type)
+{
+ return _rl_function_of_keyseq_internal (keyseq, strlen (keyseq), map, type);
+}
+
+rl_command_func_t *
+rl_function_of_keyseq_len (const char *keyseq, size_t len, Keymap map, int *type)
+{
+ return _rl_function_of_keyseq_internal (keyseq, len, map, type);
+}
+
/* The last key bindings file read. */
static char *last_readline_init_file = (char *)NULL;
char *buffer;
int i, file;
- if ((stat (filename, &finfo) < 0) || (file = open (filename, O_RDONLY, 0666)) < 0)
- return ((char *)NULL);
+ file = -1;
+ if (((file = open (filename, O_RDONLY, 0666)) < 0) || (fstat (file, &finfo) < 0))
+ {
+ if (file >= 0)
+ close (file);
+ return ((char *)NULL);
+ }
file_size = (size_t)finfo.st_size;
#! /bin/sh
-# From configure.ac for Readline 7.0, version 2.82.
+# From configure.ac for Readline 7.0, version 2.83.
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.69 for readline 7.0.
#
#endif"
ac_subst_vars='LTLIBOBJS
+TERMCAP_PKG_CONFIG_LIB
TERMCAP_LIB
LIBVERSION
ARFLAGS
fi
+case "$TERMCAP_LIB" in
+-ltinfo) TERMCAP_PKG_CONFIG_LIB=tinfo ;;
+-lcurses) TERMCAP_PKG_CONFIG_LIB=ncurses ;;
+-lncurses) TERMCAP_PKG_CONFIG_LIB=ncurses ;;
+-ltermcap) TERMCAP_PKG_CONFIG_LIB=termcap ;;
+*) TERMCAP_PKG_CONFIG_LIB=termcap ;;
+esac
+
for ac_header in wctype.h
do :
+
ac_config_files="$ac_config_files Makefile doc/Makefile examples/Makefile shlib/Makefile readline.pc"
ac_config_commands="$ac_config_commands default"
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-AC_REVISION([for Readline 7.0, version 2.82])
+AC_REVISION([for Readline 7.0, version 2.83])
AC_INIT(readline, 7.0, bug-readline@gnu.org)
AC_CHECK_HEADERS(ncurses/termcap.h)
fi
+case "$TERMCAP_LIB" in
+-ltinfo) TERMCAP_PKG_CONFIG_LIB=tinfo ;;
+-lcurses) TERMCAP_PKG_CONFIG_LIB=ncurses ;;
+-lncurses) TERMCAP_PKG_CONFIG_LIB=ncurses ;;
+-ltermcap) TERMCAP_PKG_CONFIG_LIB=termcap ;;
+*) TERMCAP_PKG_CONFIG_LIB=termcap ;;
+esac
+
BASH_CHECK_MULTIBYTE
case "$host_cpu" in
AC_SUBST(LIBVERSION)
AC_SUBST(TERMCAP_LIB)
+AC_SUBST(TERMCAP_PKG_CONFIG_LIB)
AC_OUTPUT([Makefile doc/Makefile examples/Makefile shlib/Makefile readline.pc],
[
wrap_offset. */
if (linenum == 0 && (mb_cur_max > 1 && rl_byte_oriented == 0) && OLD_CPOS_IN_PROMPT())
_rl_last_c_pos -= prompt_invis_chars_first_line; /* XXX - was wrap_offset */
- else if (linenum == prompt_last_screen_line &&
+ else if (cpos_adjusted == 0 &&
+ linenum == prompt_last_screen_line &&
prompt_physical_chars > _rl_screenwidth &&
(mb_cur_max > 1 && rl_byte_oriented == 0) &&
- cpos_adjusted == 0 &&
_rl_last_c_pos != o_cpos &&
_rl_last_c_pos > (prompt_last_invisible - _rl_screenwidth - prompt_invis_chars_first_line)) /* XXX - rethink this last one */
/* This assumes that all the invisible characters are split
between the first and last lines of the prompt, if the
prompt consumes more than two lines. It's usually right */
+ /* XXX - not sure this is ever executed */
_rl_last_c_pos -= (wrap_offset-prompt_invis_chars_first_line);
/* If this is the line with the prompt, we might need to
@var{last} may be specified as a string (to locate the most recent
command beginning with that string) or as a number (an index into the
history list, where a negative number is used as an offset from the
-current command number). If @var{last} is not specified it is set to
-@var{first}. If @var{first} is not specified it is set to the previous
+current command number). If @var{last} is not specified, it is set to
+@var{first}. If @var{first} is not specified, it is set to the previous
command for editing and @minus{}16 for listing. If the @option{-l} flag is
given, the commands are listed on standard output. The @option{-n} flag
suppresses the command numbers when listing. The @option{-r} flag
.B #
in vi command mode.
.TP
-.B completion\-display\-width (-1)
+.B completion\-display\-width (\-1)
The number of screen columns used to display possible matches
when performing completion.
The value is ignored if it is less than 0 or greater than the terminal
screen width.
A value of 0 will cause matches to be displayed one per line.
-The default value is -1.
+The default value is \-1.
.TP
.B completion\-ignore\-case (Off)
If set to \fBOn\fP, readline performs filename matching and completion
.B call\-last\-kbd\-macro (C\-x e)
Re-execute the last keyboard macro defined, by making the characters
in the macro appear as if typed at the keyboard.
+.TP
.B print\-last\-kbd\-macro ()
Print the last keyboard macro defined in a format suitable for the
\fIinputrc\fP file.
it points to (one of @code{ISFUNC}, @code{ISKMAP}, or @code{ISMACR}).
@end deftypefun
+@deftypefun {rl_command_func_t *} rl_function_of_keyseq_len (const char *keyseq, size_t len Keymap map, int *type)
+Return the function invoked by @var{keyseq} of length @var{len}
+in keymap @var{map}. Equivalent to @code{rl_function_of_keyseq} with the
+addition of the @var{len} parameter.
+@end deftypefun
+
@deftypefun {char **} rl_invoking_keyseqs (rl_command_func_t *function)
Return an array of strings representing the key sequences used to
invoke @var{function} in the current keymap.
is considered.
The string is first split using the characters in the @env{IFS}
special variable as delimiters.
-Shell quoting is honored.
+Shell quoting is honored within the string, in order to provide a
+mechanism for the words to contain shell metacharacters or characters
+in the value of @env{IFS}.
Each word is then expanded using
brace expansion, tilde expansion, parameter and variable expansion,
command substitution, and arithmetic expansion,
/* Non-zero means to read only this many characters rather than up to a
character bound to accept-line. */
-int rl_num_chars_to_read;
+int rl_num_chars_to_read = 0;
/* Line buffer and maintenance. */
char *rl_line_buffer = (char *)NULL;
extern rl_command_func_t *rl_named_function PARAMS((const char *));
extern rl_command_func_t *rl_function_of_keyseq PARAMS((const char *, Keymap, int *));
+extern rl_command_func_t *rl_function_of_keyseq_len PARAMS((const char *, size_t, Keymap, int *));
extern void rl_list_funmap_names PARAMS((void));
extern char **rl_invoking_keyseqs_in_map PARAMS((rl_command_func_t *, Keymap));
Description: Gnu Readline library for command line editing
URL: http://tiswww.cwru.edu/php/chet/readline/rltop.html
Version: @LIBVERSION@
-Requires.private: tinfo
+Requires.private: @TERMCAP_PKG_CONFIG_LIB@
Libs: -L${libdir} -lreadline
Cflags: -I${includedir}/readline
x = 0;
n = (unsigned short)-2;
while (_rl_optimize_typeahead &&
+ rl_num_chars_to_read == 0 &&
(RL_ISSTATE (RL_STATE_INPUTPENDING|RL_STATE_MACROINPUT) == 0) &&
_rl_pushed_input_available () == 0 &&
_rl_input_queued (0) &&