diff options
| author | Paul Eggert | 2015-12-23 11:47:52 -0800 |
|---|---|---|
| committer | Paul Eggert | 2015-12-23 11:49:22 -0800 |
| commit | 04dd5a502e76f11ca33550d0b03b28d3f65ee5b8 (patch) | |
| tree | 6f5c5871b895cb7e02321259cfb16c8999e0db17 /src | |
| parent | 68218d82649c7336874438a7010a180ad3e50803 (diff) | |
| download | emacs-04dd5a502e76f11ca33550d0b03b28d3f65ee5b8.tar.gz emacs-04dd5a502e76f11ca33550d0b03b28d3f65ee5b8.zip | |
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.
Diffstat (limited to 'src')
| -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, | |||
| 664 | decoded don't. For example, "a" should not match "a-ring" on | 664 | decoded don't. For example, "a" should not match "a-ring" on |
| 665 | file systems that store decomposed characters. */ | 665 | file systems that store decomposed characters. */ |
| 666 | Lisp_Object zero = make_number (0); | 666 | Lisp_Object zero = make_number (0); |
| 667 | Lisp_Object compare; | 667 | |
| 668 | Lisp_Object cmp; | ||
| 669 | if (check_decoded && SCHARS (file) <= SCHARS (name)) | 668 | if (check_decoded && SCHARS (file) <= SCHARS (name)) |
| 670 | { | 669 | { |
| 671 | compare = make_number (SCHARS (file)); | 670 | /* FIXME: This is a copy of the code below. */ |
| 672 | cmp = Fcompare_strings (name, zero, compare, file, zero, compare, | 671 | ptrdiff_t compare = SCHARS (file); |
| 673 | completion_ignore_case ? Qt : Qnil); | 672 | Lisp_Object cmp |
| 673 | = Fcompare_strings (name, zero, make_number (compare), | ||
| 674 | file, zero, make_number (compare), | ||
| 675 | completion_ignore_case ? Qt : Qnil); | ||
| 674 | if (!EQ (cmp, Qt)) | 676 | if (!EQ (cmp, Qt)) |
| 675 | continue; | 677 | continue; |
| 676 | } | 678 | } |
| @@ -689,12 +691,11 @@ file_name_completion (Lisp_Object file, Lisp_Object dirname, bool all_flag, | |||
| 689 | else | 691 | else |
| 690 | { | 692 | { |
| 691 | /* FIXME: This is a copy of the code in Ftry_completion. */ | 693 | /* FIXME: This is a copy of the code in Ftry_completion. */ |
| 692 | compare = min (bestmatchsize, SCHARS (name)); | 694 | ptrdiff_t compare = min (bestmatchsize, SCHARS (name)); |
| 693 | cmp = Fcompare_strings (bestmatch, zero, | 695 | Lisp_Object cmp |
| 694 | make_number (compare), | 696 | = Fcompare_strings (bestmatch, zero, make_number (compare), |
| 695 | name, zero, | 697 | name, zero, make_number (compare), |
| 696 | make_number (compare), | 698 | completion_ignore_case ? Qt : Qnil); |
| 697 | completion_ignore_case ? Qt : Qnil); | ||
| 698 | ptrdiff_t matchsize = EQ (cmp, Qt) ? compare : eabs (XINT (cmp)) - 1; | 699 | ptrdiff_t matchsize = EQ (cmp, Qt) ? compare : eabs (XINT (cmp)) - 1; |
| 699 | 700 | ||
| 700 | if (completion_ignore_case) | 701 | if (completion_ignore_case) |