diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2015-12-23 11:47:52 -0800 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2015-12-23 11:49:22 -0800 |
commit | 04dd5a502e76f11ca33550d0b03b28d3f65ee5b8 (patch) | |
tree | 6f5c5871b895cb7e02321259cfb16c8999e0db17 | |
parent | 68218d82649c7336874438a7010a180ad3e50803 (diff) | |
download | emacs-04dd5a502e76f11ca33550d0b03b28d3f65ee5b8.tar.gz |
Fix dired.c typo with ptrdiff_t vs Lisp_Object
* src/dired.c (file_name_completion): Don't assume Lisp_Object is
an integer type, fixing a problem introduced in the recent fix for
Bug#22169.
-rw-r--r-- | src/dired.c | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/src/dired.c b/src/dired.c index 89bd908c1e7..6c34dfdfcb0 100644 --- a/src/dired.c +++ b/src/dired.c @@ -664,13 +664,15 @@ file_name_completion (Lisp_Object file, Lisp_Object dirname, bool all_flag, decoded don't. For example, "a" should not match "a-ring" on file systems that store decomposed characters. */ Lisp_Object zero = make_number (0); - Lisp_Object compare; - Lisp_Object cmp; + if (check_decoded && SCHARS (file) <= SCHARS (name)) { - compare = make_number (SCHARS (file)); - cmp = Fcompare_strings (name, zero, compare, file, zero, compare, - completion_ignore_case ? Qt : Qnil); + /* FIXME: This is a copy of the code below. */ + ptrdiff_t compare = SCHARS (file); + Lisp_Object cmp + = Fcompare_strings (name, zero, make_number (compare), + file, zero, make_number (compare), + completion_ignore_case ? Qt : Qnil); if (!EQ (cmp, Qt)) continue; } @@ -689,12 +691,11 @@ file_name_completion (Lisp_Object file, Lisp_Object dirname, bool all_flag, else { /* FIXME: This is a copy of the code in Ftry_completion. */ - compare = min (bestmatchsize, SCHARS (name)); - cmp = Fcompare_strings (bestmatch, zero, - make_number (compare), - name, zero, - make_number (compare), - completion_ignore_case ? Qt : Qnil); + ptrdiff_t compare = min (bestmatchsize, SCHARS (name)); + Lisp_Object cmp + = Fcompare_strings (bestmatch, zero, make_number (compare), + name, zero, make_number (compare), + completion_ignore_case ? Qt : Qnil); ptrdiff_t matchsize = EQ (cmp, Qt) ? compare : eabs (XINT (cmp)) - 1; if (completion_ignore_case) |