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

From: Eli Zaretskii <[email-masked]>
Date: Sat, 14 Jan 2012 10:00:25 +0200

> From: Thierry Volpiatto <[email-masked]>
> Date: Fri, 13 Jan 2012 20:17:43 +0100
> Cc: [email-masked]
> 
>  (defun dired-copy-file-recursive (from to ok-flag &optional
>  				       preserve-time top recursive)
> -  (let ((attrs (file-attributes from)))
> +  (let* ((case-fold-search t)
> +         (fromname    (file-name-as-directory (file-truename from)))
> +         (destname    (file-name-as-directory (file-truename to)))
> +         (rem-dirname (and (equal "sudo" (file-remote-p fromname 'method))
> +                           (file-remote-p fromname 'localname)))
> +         (rem-newname (and (equal "sudo" (file-remote-p destname 'method))
> +                           (file-remote-p destname 'localname)))
> +         (attrs       (file-attributes from)))
> +    (when (equal (or rem-dirname fromname)
> +                 (or rem-newname destname))
> +      (error "Can't copy directory `%s' on itself" from))

Why is case-fold-search being unconditionally bound to t?  I don't
think this is TRT on case-sensitive filesystems.  Am I missing
something?