]> git.ipfire.org Git - thirdparty/readline.git/commitdiff
commit readline-20190906 snapshot
authorChet Ramey <chet.ramey@case.edu>
Fri, 6 Sep 2019 19:30:05 +0000 (15:30 -0400)
committerChet Ramey <chet.ramey@case.edu>
Fri, 6 Sep 2019 19:30:05 +0000 (15:30 -0400)
CHANGELOG
NEWS
colors.c
complete.c
configure
configure.ac
examples/autoconf/RL_LIB_READLINE_VERSION
terminal.c

index cfe97b322253cf42c090d352b5e72c3ec8693a04..71e9e4f2af04c45c7cc376b559b75fb36ec46120 100644 (file)
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1364,3 +1364,15 @@ readline.pc.in
                                   ----
 configure.ac
        - hpux: add -DTGETENT_BROKEN to LOCAL_CFLAGS
+
+                                  8/28
+                                  ----
+configure.ac
+       - hpux: add -DTGETFLAG_BROKEN to LOCAL_CFLAGS
+
+                                   9/6
+                                   ---
+examples/autoconf/RL_LIB_READLINE_VERSION
+       - include <stdlib.h> in the AC_TRY_RUN block to accommodate compilers
+         that treat functions without an existing prototype as fatal errors.
+         Report and fix from Florian Weimer <fweimer@redhat.com>
diff --git a/NEWS b/NEWS
index 42be21eb02c2a521108b02c83633963e6a1444e1..47a053464ab268cbb71046b34392ef7440b251e1 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -178,6 +178,27 @@ n.  New application-settable variable: rl_signal_event_hook; function that is
     called when readline is reading terminal input and read(2) is interrupted
     by a signal.  Currently not called for SIGHUP or SIGTERM.
 
+-------------------------------------------------------------------------------
+This is a terse description of the new features added to readline-6.2 since
+the release of readline-6.1.
+
+a.  The history library does not try to write the history filename in the
+    current directory if $HOME is unset.  This closes a potential security
+    problem if the application does not specify a history filename.
+
+b.  New bindable variable `completion-display-width' to set the number of
+    columns used when displaying completions.
+
+c.  New bindable variable `completion-case-map' to cause case-insensitive
+    completion to treat `-' and `_' as identical.
+
+d.  There are new bindable vi-mode command names to avoid readline's case-
+    insensitive matching not allowing them to be bound separately.
+
+e.  New bindable variable `menu-complete-display-prefix' causes the menu
+    completion code to display the common prefix of the possible completions
+    before cycling through the list, instead of after.
+
 -------------------------------------------------------------------------------
 This is a terse description of the new features added to readline-6.1 since
 the release of readline-6.0.
index 53758e0e7741401b3810d869af97e34b392be165..81aecfe0c830f804bcc0909ea0202104c120f26a 100644 (file)
--- a/colors.c
+++ b/colors.c
@@ -175,7 +175,7 @@ _rl_print_color_indicator (const char *f)
 
   if (linkok == -1 && _rl_color_indicator[C_MISSING].string != NULL)
     colored_filetype = C_MISSING;
-  else if (linkok == 0 && S_ISLNK(mode) && _rl_color_indicator[C_ORPHAN].string != NULL)
+  else if (linkok == 0 && _rl_color_indicator[C_ORPHAN].string != NULL)
     colored_filetype = C_ORPHAN;       /* dangling symlink */
   else if(stat_ok != 0)
     {
index 7da8ee98f4e60ae9adc023f670f2b14de1d383fc..bd82ab9ff32aa810a2611548c41f681ced058635 100644 (file)
@@ -429,7 +429,11 @@ rl_complete (int ignore, int invoking_key)
 
   if (rl_inhibit_completion)
     return (_rl_insert_char (ignore, invoking_key));
+#if 0
   else if (rl_last_func == rl_complete && completion_changed_buffer == 0 && last_completion_failed == 0)
+#else
+  else if (rl_last_func == rl_complete && completion_changed_buffer == 0)
+#endif
     return (rl_complete_internal ('?'));
   else if (_rl_complete_show_all)
     return (rl_complete_internal ('!'));
@@ -1987,10 +1991,12 @@ rl_complete_internal (int what_to_do)
   int start, end, delimiter, found_quote, i, nontrivial_lcd;
   char *text, *saved_line_buffer;
   char quote_char;
-  int tlen, mlen;
+  int tlen, mlen, saved_last_completion_failed;
 
   RL_SETSTATE(RL_STATE_COMPLETING);
 
+  saved_last_completion_failed = last_completion_failed;
+
   set_completion_defaults (what_to_do);
 
   saved_line_buffer = rl_line_buffer ? savestring (rl_line_buffer) : (char *)NULL;
@@ -2104,6 +2110,15 @@ rl_complete_internal (int what_to_do)
       break;
 
     case '?':
+      /* Let's try to insert a single match here if the last completion failed
+        but this attempt returned a single match. */
+      if (saved_last_completion_failed && matches[0] && *matches[0] && matches[1] == 0)
+       {
+         insert_match (matches[0], start, matches[1] ? MULT_MATCH : SINGLE_MATCH, &quote_char);
+         append_to_match (matches[0], delimiter, quote_char, nontrivial_lcd);
+         break;
+       }
+      
       if (rl_completion_display_matches_hook == 0)
        {
          _rl_sigcleanup = _rl_complete_sigcleanup;
index b4c84609f94717400fe7a765d6f499816a25d72e..16b30bc7599a9c7b00d42e3f5e67594675fd4283 100755 (executable)
--- a/configure
+++ b/configure
@@ -5320,6 +5320,7 @@ else
 #ifdef HAVE_UNISTD_H
 #include <unistd.h>
 #endif
+#include <stdlib.h>
 
 typedef RETSIGTYPE sigfunc();
 
@@ -5400,6 +5401,7 @@ else
 #include <sys/types.h>
 #include <signal.h>
 #include <setjmp.h>
+#include <stdlib.h>
 
 main()
 {
@@ -6807,7 +6809,7 @@ esac
 
 case "$host_os" in
 isc*)  LOCAL_CFLAGS=-Disc386 ;;
-hpux*) LOCAL_CFLAGS=-DTGETENT_BROKEN ;;
+hpux*) LOCAL_CFLAGS="-DTGETENT_BROKEN -DTGETFLAG_BROKEN" ;;
 esac
 
 # shared library configuration section
index 5f56b449351ecd6b0e3a34836efb169588df64ec..cf74a32a5767bdd1b7193724c61c880b8ae0a6bd 100644 (file)
@@ -215,7 +215,7 @@ esac
 
 case "$host_os" in
 isc*)  LOCAL_CFLAGS=-Disc386 ;;
-hpux*) LOCAL_CFLAGS=-DTGETENT_BROKEN ;;
+hpux*) LOCAL_CFLAGS="-DTGETENT_BROKEN -DTGETFLAG_BROKEN" ;;
 esac
 
 # shared library configuration section
index 883942c4b33c770f5e7b3d3caf3697bb3df93e41..cc158a8dabf8eea54f768ac05c195f5dea7e982f 100644 (file)
@@ -35,6 +35,7 @@ AC_CACHE_VAL(ac_cv_rl_version,
 [AC_TRY_RUN([
 #include <stdio.h>
 #include <readline/readline.h>
+#include <stdlib.h>
 
 extern int rl_gnu_readline_p;
 
index fa0043820ad2b513b6072d687dc33422f7d64773..86299f54ff3e3543399bc3f658fd7283730e4af8 100644 (file)
@@ -177,6 +177,19 @@ static char *_rl_term_kI;
 static char *_rl_term_vs;      /* very visible */
 static char *_rl_term_ve;      /* normal */
 
+/* It's not clear how HPUX is so broken here. */
+#ifdef TGETENT_BROKEN
+#  define TGETENT_SUCCESS 0
+#else
+#  define TGETENT_SUCCESS 1
+#endif
+#ifdef TGETFLAG_BROKEN
+#  define TGETFLAG_SUCCESS 0
+#else
+#  define TGETFLAG_SUCCESS 1
+#endif
+#define TGETFLAG(cap)  (tgetflag (cap) == TGETFLAG_SUCCESS)
+
 static void bind_termcap_arrow_keys PARAMS((Keymap));
 
 /* Variables that hold the screen dimensions, used by the display code. */
@@ -483,11 +496,7 @@ _rl_init_terminal_io (const char *terminal_name)
       tgetent_ret = tgetent (term_buffer, term);
     }
 
-#ifdef TGETENT_BROKEN
-  if (tgetent_ret < 0)
-#else
-  if (tgetent_ret <= 0)
-#endif
+  if (tgetent_ret != TGETENT_SUCCESS)
     {
       FREE (term_string_buffer);
       FREE (term_buffer);
@@ -548,7 +557,7 @@ _rl_init_terminal_io (const char *terminal_name)
   if (!_rl_term_cr)
     _rl_term_cr = "\r";
 
-  _rl_term_autowrap = tgetflag ("am") && tgetflag ("xn");
+  _rl_term_autowrap = TGETFLAG ("am") && TGETFLAG ("xn");
 
   /* Allow calling application to set default height and width, using
      rl_set_screen_size */
@@ -563,7 +572,7 @@ _rl_init_terminal_io (const char *terminal_name)
 
   /* Check to see if this terminal has a meta key and clear the capability
      variables if there is none. */
-  term_has_meta = tgetflag ("km") != 0;
+  term_has_meta = TGETFLAG ("km");
   if (term_has_meta == 0)
     _rl_term_mm = _rl_term_mo = (char *)NULL;
 #endif /* !__MSDOS__ */