]> git.eshelyaron.com Git - emacs.git/commitdiff
Check FROM arg to substring in icomplete-completions
authorLeo Liu <sdl.web@gmail.com>
Mon, 20 Feb 2012 08:06:52 +0000 (16:06 +0800)
committerLeo Liu <sdl.web@gmail.com>
Mon, 20 Feb 2012 08:06:52 +0000 (16:06 +0800)
See: http://debbugs.gnu.org/10850

lisp/ChangeLog
lisp/icomplete.el

index cc5851373b06618c9f3dbe0c28b6b48fe0e833ce..629b5b19d935d859838c19c7ff2a76cf5729f673 100644 (file)
@@ -1,3 +1,8 @@
+2012-02-20  Leo Liu  <sdl.web@gmail.com>
+
+       * icomplete.el (icomplete-completions): Check FROM arg before
+       passing to substring (Bug#10850).
+
 2012-02-19  Chong Yidong  <cyd@gnu.org>
 
        * comint.el: Require ansi-color.
index 80a0bf1435b9119951e97d01f484dc350e17799b..a971965195732bd1e1c4000b19bdc53b920d2ff9 100644 (file)
@@ -347,7 +347,9 @@ are exhibited within the square braces.)"
            (setq prospects nil)
          (while (and comps (not limit))
            (setq comp
-                  (if prefix-len (substring (car comps) prefix-len) (car comps))
+                 (if (and prefix-len (<= prefix-len (length (car comps))))
+                     (substring (car comps) prefix-len)
+                   (car comps))
                  comps (cdr comps))
            (cond ((string-equal comp "") (setq most-is-exact t))
                  ((member comp prospects))