diff options
| author | Leo Liu | 2012-02-20 16:06:52 +0800 |
|---|---|---|
| committer | Leo Liu | 2012-02-20 16:06:52 +0800 |
| commit | ab1ce9d7e2d5bda36e361583237e0b76a4a17298 (patch) | |
| tree | 9677815d64a89d6a82a0fa17c3a4d27657c38096 /lisp | |
| parent | b0668aa847fc5112debd686291aa457d252482e1 (diff) | |
| download | emacs-ab1ce9d7e2d5bda36e361583237e0b76a4a17298.tar.gz emacs-ab1ce9d7e2d5bda36e361583237e0b76a4a17298.zip | |
Check FROM arg to substring in icomplete-completions
See: http://debbugs.gnu.org/10850
Diffstat (limited to 'lisp')
| -rw-r--r-- | lisp/ChangeLog | 5 | ||||
| -rw-r--r-- | lisp/icomplete.el | 4 |
2 files changed, 8 insertions, 1 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index cc5851373b0..629b5b19d93 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2012-02-20 Leo Liu <sdl.web@gmail.com> | ||
| 2 | |||
| 3 | * icomplete.el (icomplete-completions): Check FROM arg before | ||
| 4 | passing to substring (Bug#10850). | ||
| 5 | |||
| 1 | 2012-02-19 Chong Yidong <cyd@gnu.org> | 6 | 2012-02-19 Chong Yidong <cyd@gnu.org> |
| 2 | 7 | ||
| 3 | * comint.el: Require ansi-color. | 8 | * comint.el: Require ansi-color. |
diff --git a/lisp/icomplete.el b/lisp/icomplete.el index 80a0bf1435b..a9719651957 100644 --- a/lisp/icomplete.el +++ b/lisp/icomplete.el | |||
| @@ -347,7 +347,9 @@ are exhibited within the square braces.)" | |||
| 347 | (setq prospects nil) | 347 | (setq prospects nil) |
| 348 | (while (and comps (not limit)) | 348 | (while (and comps (not limit)) |
| 349 | (setq comp | 349 | (setq comp |
| 350 | (if prefix-len (substring (car comps) prefix-len) (car comps)) | 350 | (if (and prefix-len (<= prefix-len (length (car comps)))) |
| 351 | (substring (car comps) prefix-len) | ||
| 352 | (car comps)) | ||
| 351 | comps (cdr comps)) | 353 | comps (cdr comps)) |
| 352 | (cond ((string-equal comp "") (setq most-is-exact t)) | 354 | (cond ((string-equal comp "") (setq most-is-exact t)) |
| 353 | ((member comp prospects)) | 355 | ((member comp prospects)) |