From: Stefan Monnier Date: Tue, 9 Apr 2013 20:10:47 +0000 (-0400) Subject: * src/minibuf.c (Ftest_completion): Ignore non-string/symbol keys in hash X-Git-Tag: emacs-24.3.90~173^2^2~42^2~45^2~387^2~2026^2~497 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=a8036e4076f6d43537905e3aaf400992fdef38e4;p=emacs.git * src/minibuf.c (Ftest_completion): Ignore non-string/symbol keys in hash tables. Fixes: debbugs:14054 --- diff --git a/src/ChangeLog b/src/ChangeLog index 04dcee7b6eb..402792b5460 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2013-04-09 Stefan Monnier + + * minibuf.c (Ftest_completion): Ignore non-string/symbol keys in hash + tables (bug#14054). + 2013-04-08 Stefan Monnier * window.c (select_window): Don't record_buffer while the invariant is diff --git a/src/minibuf.c b/src/minibuf.c index 68c39310f01..4cc1f8d435a 100644 --- a/src/minibuf.c +++ b/src/minibuf.c @@ -1800,17 +1800,21 @@ the values STRING, PREDICATE and `lambda'. */) { struct Lisp_Hash_Table *h = XHASH_TABLE (collection); i = hash_lookup (h, string, NULL); + Lisp_Object key = Qnil; if (i >= 0) tem = HASH_KEY (h, i); else for (i = 0; i < HASH_TABLE_SIZE (h); ++i) if (!NILP (HASH_HASH (h, i)) + && (key = HASH_KEY (h, i), + SYMBOLP (key) ? key = Fsymbol_name (key) : key, + STRINGP (key)) && EQ (Fcompare_strings (string, make_number (0), Qnil, - HASH_KEY (h, i), make_number (0) , Qnil, + key, make_number (0) , Qnil, completion_ignore_case ? Qt : Qnil), Qt)) { - tem = HASH_KEY (h, i); + tem = key; break; } if (!STRINGP (tem))