]> git.ipfire.org Git - thirdparty/bash.git/commitdiff
commit bash-20110715 snapshot
authorChet Ramey <chet.ramey@case.edu>
Mon, 9 Jan 2012 13:23:50 +0000 (08:23 -0500)
committerChet Ramey <chet.ramey@case.edu>
Mon, 9 Jan 2012 13:23:50 +0000 (08:23 -0500)
CWRU/CWRU.chlog
lib/readline/isearch.c
tests/COPYRIGHT

index 816265eb597182d00c60b93842f9e194f9002e60..ae94a34b063a39eb03c469b7e61b6f038879819b 100644 (file)
@@ -11967,3 +11967,10 @@ builtins/shopt.def
 
 doc/{bash.1,bashref.texi}
        - document new `direxpand' shopt option
+
+                                  7/15
+                                  ----
+lib/readline/isearch.c
+       - _rl_isearch_dispatch: when adding character to search string, use
+         cxt->lastc (which we use in the switch statement) instead of c,
+         since lastc can be modified earlier in the function
index de29e6163345baa6382fb02e0e5f0be88bb77c3e..a7b2be41f405a2925c3f7143fbf666ee0b1d32b8 100644 (file)
@@ -394,6 +394,24 @@ _rl_isearch_dispatch (cxt, c)
          rl_execute_next (cxt->prevc);
          return (0);
        }
+      /* Otherwise, if the current character is mapped to self-insert (i.e.,
+        not an editing command), and the previous character was a keymap
+        index, then we need to insert both the previous character and the
+        current character into the search string. */
+      else if (cxt->lastc > 0 && cxt->prevc > 0 &&
+              cxt->keymap[cxt->prevc].type == ISKMAP &&
+              cxt->okeymap[cxt->lastc].type == ISFUNC && cxt->okeymap[cxt->lastc].function == rl_insert)
+       {
+         /* Make lastc be the next character read */
+         rl_execute_next (cxt->lastc);
+         /* Dispatch on the previous character (insert into search string) */
+         cxt->lastc = cxt->prevc;
+         /* Have to overwrite cxt->mb here because dispatch uses it below */
+         cxt->mb[0] = cxt->lastc;
+         cxt->mb[1] = '\0';
+
+         cxt->prevc = 0;         
+       }
     }
 
   /* The characters in isearch_terminators (set from the user-settable
@@ -564,7 +582,7 @@ _rl_isearch_dispatch (cxt, c)
        }
       else
 #endif
-       cxt->search_string[cxt->search_string_index++] = c;
+       cxt->search_string[cxt->search_string_index++] = cxt->lastc;    /* XXX - was c instead of lastc */
       cxt->search_string[cxt->search_string_index] = '\0';
       break;
     }
index c69f29793b39ce8f0676e3d574796cfde541119d..57d472109f36deb8e4e97552bd6372937c3d160b 100644 (file)
@@ -1,6 +1,6 @@
 Unless otherwise stated, all files in this directory are Copyright (C)
 1991,1992,1993,1994,1995,1996,1997,1998,1999,2000,2001,2002,2003,
-2004,2005,2006,2007,2008,2009
+2004,2005,2006,2007,2008,2009,2010,2011
 Free Software Foundation, Inc.
 
 The file ifs-posix.tests is Copyright (C) 2005 Glen Fowler.