emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] emacs-25 04dd5a5: Fix dired.c typo with ptrdiff_t vs Lisp_


From: Paul Eggert
Subject: [Emacs-diffs] emacs-25 04dd5a5: Fix dired.c typo with ptrdiff_t vs Lisp_Object
Date: Wed, 23 Dec 2015 19:49:25 +0000

branch: emacs-25
commit 04dd5a502e76f11ca33550d0b03b28d3f65ee5b8
Author: Paul Eggert <address@hidden>
Commit: Paul Eggert <address@hidden>

    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 files changed, 12 insertions(+), 11 deletions(-)

diff --git a/src/dired.c b/src/dired.c
index 89bd908..6c34dfd 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)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]