GNU bug report logs - #10489
24.0.92; dired-do-copy may create infinite directory hierarchy

Previous Next

Package: emacs;

Reported by: michael_heerdegen <at> web.de

Date: Thu, 12 Jan 2012 19:36:01 UTC

Severity: important

Tags: patch

Merged with 11130

Found in version 24.0.92

Done: Chong Yidong <cyd <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


Message #519 received at 10489 <at> debbugs.gnu.org (full text, mbox):

From: Michael Albinus <michael.albinus <at> gmx.de>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: 10489 <at> debbugs.gnu.org, Thierry Volpiatto <thierry.volpiatto <at> gmail.com>
Subject: Re: bug#10489: 24.0.92;
	dired-do-copy may create infinite directory hierarchy
Date: Wed, 29 Feb 2012 12:04:39 +0100
Stefan Monnier <monnier <at> iro.umontreal.ca> writes:

>>>> `files-equal-p' still returns t for two non-existing files. Shall be
>>>> fixed too.
>>> I don't see why that should be fixed: files-equal-p only works for
>>> existing files.  If one or both of the files don't exist, the return
>>> value is unspecified.  Oh, yes, the doc needs to be fixed to say it clearly.
>> Why is this better than returning nil (which is easy to achieve)?
>
> It's not.

I see. There might be optimizations in file name handlers, for example
returning immediately t when both file names are identical.

Maybe we could change the entry in files.texi like this:

--8<---------------cut here---------------start------------->8---
*** /home/albinus/src/emacs/doc/lispref/files.texi.~107463~  2012-02-29 11:58:54.000000000 +0100
--- /home/albinus/src/emacs/doc/lispref/files.texi  2012-02-29 11:58:55.000000000 +0100
***************
*** 1020,1028 ****
  
  @defun file-equal-p file1 file2
  This function returns @code{t} if the files @var{file1} and
! @var{file2} name the same file.  Two ordinary files are considered to
! be the same if the function @code{file-attributes} (@pxref{File
! Attributes}) returns @code{equal} values for them.
  @end defun
  
  @defun file-subdir-of-p dir1 dir2
--- 1020,1034 ----
  
  @defun file-equal-p file1 file2
  This function returns @code{t} if the files @var{file1} and
! @var{file2} name the same file.  If @var{file1} or @var{file2} does
! not exist, the return value is unspecified.
! 
! If two files are equal, it does not imply that both file names specify
! accessible files.  For example, @file{/sudo::/foo/bar} might be
! accessible, but @file{file:///foo/bar} might not.  (@pxref{Remote
! Files,, Remote Files, emacs, The GNU Emacs Manual}, and
! @pxref{Supported URL Types,, Supported URL Types, url, URL
! Programmer's Manual})
  @end defun
  
  @defun file-subdir-of-p dir1 dir2
--8<---------------cut here---------------end--------------->8---

>         Stefan

Best regards, Michael.




This bug report was last modified 13 years and 58 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.