From: Chet Ramey Date: Mon, 12 Oct 2015 17:55:35 +0000 (-0400) Subject: readline-7.0 beta distribution X-Git-Tag: readline-7.0-beta X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=abfb7e244d1d599fe6469ad300290efebaa10215;p=thirdparty%2Freadline.git readline-7.0 beta distribution --- diff --git a/CHANGELOG b/CHANGELOG index 9d03dca..6794591 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1299,3 +1299,8 @@ configure.ac,config.h.in ---- configure.ac - bump library version to 7.0 because of addition of rl_callback_sigcleanup + + 8/26 + ---- +configure.ac,Makefile.in,examples/Makefile.in + - remove references to purify diff --git a/CHANGES b/CHANGES index 8436701..13d75fc 100644 --- a/CHANGES +++ b/CHANGES @@ -55,6 +55,29 @@ q. Fixed a bug that caused readline commands that depend on knowing which r. Paren matching now works in vi insert mode. +s. Colored completion prefixes are now displayed using a different color, less + likely to collide with files. + +t. Fixed a bug that caused vi-mode character search to misbehave when + running in callback mode. + +u. Fixed a bug that caused output to be delayed when input is coming from a + macro in vi-mode. + +v. Fixed a bug that caused the vi-mode `.' command to misbehave when redoing + a multi-key key sequence via a macro. + +w. Fixed a bug that caused problems with applications that supply their own + input function when performing completion. + +x. When read returns -1/EIO when attempting to read a key, return an error + instead of line termination back to the caller. + +y. Updated tty auditing feature based on patch from Red Hat. + +z. Fixed a bug that could cause the history library to crash on overflows + introduced by malicious editing of timestamps in the history file. + 2. New Features in Readline a. The history truncation code now uses the same error recovery mechansim as diff --git a/Makefile.in b/Makefile.in index ecaf06d..6522573 100644 --- a/Makefile.in +++ b/Makefile.in @@ -45,8 +45,6 @@ RM = rm -f CP = cp MV = mv -PURIFY = @PURIFY@ - @SET_MAKE@ SHELL = @MAKE_SHELL@ @@ -116,7 +114,7 @@ CSOURCES = $(srcdir)/readline.c $(srcdir)/funmap.c $(srcdir)/keymaps.c \ $(srcdir)/histfile.c $(srcdir)/nls.c $(srcdir)/search.c \ $(srcdir)/shell.c $(srcdir)/savestring.c $(srcdir)/tilde.c \ $(srcdir)/text.c $(srcdir)/misc.c $(srcdir)/compat.c \ - $(srcdir)/mbutil.c $(srcdir)/xfree.c + $(srcdir)/mbutil.c # The header files for this library. HSOURCES = $(srcdir)/readline.h $(srcdir)/rldefs.h $(srcdir)/chardefs.h \ diff --git a/callback.c b/callback.c index 0fc3f90..ec48b76 100644 --- a/callback.c +++ b/callback.c @@ -161,6 +161,36 @@ rl_callback_read_char () CALLBACK_READ_RETURN (); } #if defined (VI_MODE) + /* States that can occur while in state VIMOTION have to be checked + before RL_STATE_VIMOTION */ + else if (RL_ISSTATE (RL_STATE_CHARSEARCH)) + { + int k; + + k = _rl_callback_data->i2; + + eof = (*_rl_callback_func) (_rl_callback_data); + /* If the function `deregisters' itself, make sure the data is + cleaned up. */ + if (_rl_callback_func == 0) /* XXX - just sanity check */ + { + if (_rl_callback_data) + { + _rl_callback_data_dispose (_rl_callback_data); + _rl_callback_data = 0; + } + } + + /* Messy case where vi motion command can be char search */ + if (RL_ISSTATE (RL_STATE_VIMOTION)) + { + _rl_vi_domove_motion_cleanup (k, _rl_vimvcxt); + _rl_internal_char_cleanup (); + CALLBACK_READ_RETURN (); + } + + _rl_internal_char_cleanup (); + } else if (RL_ISSTATE (RL_STATE_VIMOTION)) { eof = _rl_vi_domove_callback (_rl_vimvcxt); @@ -311,6 +341,8 @@ rl_callback_sigcleanup () } else if (RL_ISSTATE (RL_STATE_MULTIKEY)) RL_UNSETSTATE (RL_STATE_MULTIKEY); + if (RL_ISSTATE (RL_STATE_CHARSEARCH)) + RL_UNSETSTATE (RL_STATE_CHARSEARCH); _rl_callback_func = 0; } diff --git a/colors.c b/colors.c index 963dc12..d4bcb32 100644 --- a/colors.c +++ b/colors.c @@ -120,7 +120,7 @@ _rl_print_prefix_color (void) /* Returns whether any color sequence was printed. */ bool -_rl_print_color_indicator (char *f) +_rl_print_color_indicator (const char *f) { enum indicator_no colored_filetype; COLOR_EXT_TYPE *ext; /* Color extension */ diff --git a/colors.h b/colors.h index 8627bd4..ec62774 100644 --- a/colors.h +++ b/colors.h @@ -114,13 +114,13 @@ enum filetype arg_directory }; -/* Prefix color, currently same as directory */ -#define C_PREFIX C_DIR +/* Prefix color, currently same as socket */ +#define C_PREFIX C_SOCK extern void _rl_put_indicator (const struct bin_str *ind); extern void _rl_set_normal_color (void); extern bool _rl_print_prefix_color (void); -extern bool _rl_print_color_indicator (char *f); +extern bool _rl_print_color_indicator (const char *f); extern void _rl_prep_non_filename_text (void); #endif /* !_COLORS_H_ */ diff --git a/complete.c b/complete.c index 302ea1d..d0bbe7d 100644 --- a/complete.c +++ b/complete.c @@ -111,7 +111,7 @@ static int stat_char PARAMS((char *)); #endif #if defined (COLOR_SUPPORT) -static int colored_stat_start PARAMS((char *)); +static int colored_stat_start PARAMS((const char *)); static void colored_stat_end PARAMS((void)); static int colored_prefix_start PARAMS((void)); static void colored_prefix_end PARAMS((void)); @@ -128,7 +128,7 @@ static int get_y_or_n PARAMS((int)); static int _rl_internal_pager PARAMS((int)); static char *printable_part PARAMS((char *)); static int fnwidth PARAMS((const char *)); -static int fnprint PARAMS((const char *, int)); +static int fnprint PARAMS((const char *, int, const char *)); static int print_filename PARAMS((char *, char *, int)); static char **gen_completion_matches PARAMS((char *, int, int, rl_compentry_func_t *, int, int)); @@ -212,6 +212,8 @@ int rl_visible_stats = 0; completions. The colors used are taken from $LS_COLORS, if set. */ int _rl_colored_stats = 0; +/* Non-zero means to use a color (currently magenta) to indicate the common + prefix of a set of possible word completions. */ int _rl_colored_completion_prefix = 1; #endif @@ -674,7 +676,7 @@ stat_char (filename) #if defined (COLOR_SUPPORT) static int colored_stat_start (filename) - char *filename; + const char *filename; { _rl_set_normal_color (); return (_rl_print_color_indicator (filename)); @@ -726,6 +728,8 @@ printable_part (pathname) if (temp == 0 || *temp == '\0') return (pathname); + else if (temp[1] == 0 && temp == pathname) + return (pathname); /* If the basename is NULL, we might have a pathname like '/usr/src/'. Look for a previous slash and, if one is found, return the portion following that slash. If there's no previous slash, just return the @@ -796,9 +800,10 @@ fnwidth (string) #define ELLIPSIS_LEN 3 static int -fnprint (to_print, prefix_bytes) +fnprint (to_print, prefix_bytes, real_pathname) const char *to_print; int prefix_bytes; + const char *real_pathname; { int printed_len, w; const char *s; @@ -817,10 +822,17 @@ fnprint (to_print, prefix_bytes) printed_len = common_prefix_len = 0; /* Don't print only the ellipsis if the common prefix is one of the - possible completions */ - if (to_print[prefix_bytes] == '\0') + possible completions. Only cut off prefix_bytes if we're going to be + printing the ellipsis, which takes precedence over coloring the + completion prefix (see print_filename() below). */ + if (_rl_completion_prefix_display_length > 0 && to_print[prefix_bytes] == '\0') prefix_bytes = 0; +#if defined (COLOR_SUPPORT) + if (_rl_colored_stats && (prefix_bytes == 0 || _rl_colored_completion_prefix <= 0)) + colored_stat_start (real_pathname); +#endif + if (prefix_bytes && _rl_completion_prefix_display_length > 0) { char ellipsis; @@ -891,13 +903,23 @@ fnprint (to_print, prefix_bytes) } if (common_prefix_len > 0 && (s - to_print) >= common_prefix_len) { +#if defined (COLOR_SUPPORT) /* printed bytes = s - to_print */ /* printed bytes should never be > but check for paranoia's sake */ colored_prefix_end (); + if (_rl_colored_stats) + colored_stat_start (real_pathname); /* XXX - experiment */ +#endif common_prefix_len = 0; } } +#if defined (COLOR_SUPPORT) + /* XXX - unconditional for now */ + if (_rl_colored_stats) + colored_stat_end (); +#endif + return printed_len; } @@ -918,7 +940,7 @@ print_filename (to_print, full_pathname, prefix_bytes) /* Defer printing if we want to prefix with a color indicator */ if (_rl_colored_stats == 0 || rl_filename_completion_desired == 0) #endif - printed_len = fnprint (to_print, prefix_bytes); + printed_len = fnprint (to_print, prefix_bytes, to_print); if (rl_filename_completion_desired && ( #if defined (VISIBLE_STATS) @@ -987,13 +1009,10 @@ print_filename (to_print, full_pathname, prefix_bytes) extension_char = '/'; } + /* Move colored-stats code inside fnprint() */ #if defined (COLOR_SUPPORT) if (_rl_colored_stats) - { - colored_stat_start (new_full_pathname); - printed_len = fnprint (to_print, prefix_bytes); - colored_stat_end (); - } + printed_len = fnprint (to_print, prefix_bytes, new_full_pathname); #endif xfree (new_full_pathname); @@ -1010,15 +1029,11 @@ print_filename (to_print, full_pathname, prefix_bytes) if (_rl_complete_mark_directories && path_isdir (s)) extension_char = '/'; + /* Move colored-stats code inside fnprint() */ #if defined (COLOR_SUPPORT) if (_rl_colored_stats) - { - colored_stat_start (s); - printed_len = fnprint (to_print, prefix_bytes); - colored_stat_end (); - } + printed_len = fnprint (to_print, prefix_bytes, s); #endif - } xfree (s); diff --git a/config.h.in b/config.h.in index e5658c2..d03ebe0 100644 --- a/config.h.in +++ b/config.h.in @@ -155,6 +155,9 @@ /* Define if you have the header file. */ #undef HAVE_LANGINFO_H +/* Define if you have the header file. */ +#undef HAVE_LIBAUDIT_H + /* Define if you have the header file. */ #undef HAVE_LIMITS_H diff --git a/configure b/configure index 1d80b94..d200b96 100755 --- a/configure +++ b/configure @@ -631,7 +631,6 @@ LOCAL_DEFS LOCAL_LDFLAGS LOCAL_CFLAGS BUILD_DIR -PURIFY SHARED_INSTALL_TARGET STATIC_INSTALL_TARGET SHARED_TARGET @@ -722,7 +721,6 @@ ac_subst_files='' ac_user_opts=' enable_option_checking with_curses -with_purify enable_multibyte enable_shared enable_static @@ -1360,7 +1358,6 @@ Optional Packages: --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-curses use the curses library instead of the termcap library - --with-purify configure to postprocess with purify Some influential environment variables: CC C compiler command @@ -2367,7 +2364,6 @@ case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac opt_curses=no -opt_purify=no # Check whether --with-curses was given. @@ -2376,22 +2372,10 @@ if test "${with_curses+set}" = set; then : fi -# Check whether --with-purify was given. -if test "${with_purify+set}" = set; then : - withval=$with_purify; opt_purify=$withval -fi - - if test "$opt_curses" = "yes"; then prefer_curses=yes fi -if test "$opt_purify" = yes; then - PURIFY="purify" -else - PURIFY= -fi - opt_multibyte=yes opt_static_libs=yes opt_shared_libs=yes @@ -5878,6 +5862,18 @@ $as_echo "#define HAVE_STRUCT_DIRENT_D_FILENO 1" >>confdefs.h fi +for ac_header in libaudit.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "libaudit.h" "ac_cv_header_libaudit_h" "$ac_includes_default" +if test "x$ac_cv_header_libaudit_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBAUDIT_H 1 +_ACEOF + +fi + +done + ac_fn_c_check_decl "$LINENO" "AUDIT_USER_TTY" "ac_cv_have_decl_AUDIT_USER_TTY" "#include " if test "x$ac_cv_have_decl_AUDIT_USER_TTY" = xyes; then : @@ -6624,7 +6620,6 @@ esac - ac_config_files="$ac_config_files Makefile doc/Makefile examples/Makefile shlib/Makefile readline.pc" ac_config_commands="$ac_config_commands default" diff --git a/configure.ac b/configure.ac index 42e21fa..27a9a02 100644 --- a/configure.ac +++ b/configure.ac @@ -39,22 +39,14 @@ AC_CANONICAL_BUILD dnl configure defaults opt_curses=no -opt_purify=no dnl arguments to configure AC_ARG_WITH(curses, AC_HELP_STRING([--with-curses], [use the curses library instead of the termcap library]), opt_curses=$withval) -AC_ARG_WITH(purify, AC_HELP_STRING([--with-purify], [configure to postprocess with purify]), opt_purify=$withval) if test "$opt_curses" = "yes"; then prefer_curses=yes fi -if test "$opt_purify" = yes; then - PURIFY="purify" -else - PURIFY= -fi - dnl option parsing for optional features opt_multibyte=yes opt_static_libs=yes @@ -184,6 +176,7 @@ BASH_STRUCT_WINSIZE BASH_STRUCT_DIRENT_D_INO BASH_STRUCT_DIRENT_D_FILENO +AC_CHECK_HEADERS(libaudit.h) AC_CHECK_DECLS([AUDIT_USER_TTY],,, [[#include ]]) dnl yuck @@ -283,7 +276,6 @@ case "$BUILD_DIR" in *) ;; esac -AC_SUBST(PURIFY) AC_SUBST(BUILD_DIR) AC_SUBST(CFLAGS) diff --git a/display.c b/display.c index c6b14fb..4353d6e 100644 --- a/display.c +++ b/display.c @@ -83,8 +83,8 @@ struct line_state int *lbreaks; int lbsize; #if defined (HANDLE_MULTIBYTE) - int *wrapped_line; int wbsize; + int *wrapped_line; #endif }; diff --git a/doc/history.dvi b/doc/history.dvi index 2b51dc7..7007d52 100644 Binary files a/doc/history.dvi and b/doc/history.dvi differ diff --git a/doc/history.html b/doc/history.html index ce35004..cba7535 100644 --- a/doc/history.html +++ b/doc/history.html @@ -1,6 +1,6 @@ - +