Subject: RE: bug#10489: 24.0.92; dired-do-copy may create infinite directory hierarchy

From: "Drew Adams" <[email-masked]>
Date: Sun, 15 Jan 2012 10:42:45 -0800

> (defun bmkp-same-file-p (file1 file2)
>   "Return non-nil if FILE1 and FILE2 name the same file.
> If either name is not absolute, then it is expanded relative to
> `default-directory' for the test."
>   (let* ((remote1  (bmkp-file-remote-p file1))
>          (remote2  (bmkp-file-remote-p file2))
>          (ignore-case-p
>           (and (not remote1) (not remote2)
>                (eval (car (get 'read-file-name-completion-ignore-case
>                                'standard-value))))))
>     (and (equal remote1 remote2)
>          (compare-strings (file-truename (expand-file-name file1))
>                           (file-truename (expand-file-name file2))
>                           ignore-case-p))))

Sorry, that `compare-strings' sexp is obviously not right.  The last 3 lines
should be this:

(and (equal remote1 remote2)
     (let ((ft1  (file-truename (expand-file-name file1)))
           (ft2  (file-truename (expand-file-name file2))))
       (compare-strings ft1 0 (length ft1) ft2 0 (length ft2)
                        ignore-case-p)))))