From 04dd5a502e76f11ca33550d0b03b28d3f65ee5b8 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Wed, 23 Dec 2015 11:47:52 -0800 Subject: [PATCH] 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. --- src/dired.c | 23 ++++++++++++----------- 1 file 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) -- 2.39.2