X-Git-Url: http://git.hcoop.net/bpt/emacs.git/blobdiff_plain/06e21633a4a9de1e8013376cf92d912817df28cd..68af8d4fc3bcdf9c9123f66283d0005cf91e34b0:/lisp/icomplete.el diff --git a/lisp/icomplete.el b/lisp/icomplete.el index 53876f48a0..a971965195 100644 --- a/lisp/icomplete.el +++ b/lisp/icomplete.el @@ -1,6 +1,6 @@ ;;; icomplete.el --- minibuffer completion incremental feedback -;; Copyright (C) 1992-1994, 1997, 1999, 2001-2011 +;; Copyright (C) 1992-1994, 1997, 1999, 2001-2012 ;; Free Software Foundation, Inc. ;; Author: Ken Manheimer @@ -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))