emacs-pretest-bug
[Top][All Lists]
Advanced

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

Re: Dangerous behavior when copying to current directory


From: Juri Linkov
Subject: Re: Dangerous behavior when copying to current directory
Date: Tue, 15 Mar 2005 16:09:38 +0200
User-agent: Gnus/5.110002 (No Gnus v0.2) Emacs/22.0.50 (gnu/linux)

Richard Stallman <address@hidden> writes:
> I found a way to fix this to do what people want.

Your fix works only for the case where a specified directory has no
final slash.  But after invoking M-x copy-file or M-x rename-file
the default initial value for the second argument has a final slash,
e.g. `/tmp/'.  Since `copy-file' and `rename-file' have interactive
specification `F' for the second argument, when they get called with
the default value after typing RET, the second argument is already
expanded to the wrong file name.  The culprit is the function
`read-file-name' which always adds the current buffer name to the
returned value when a directory name was specified by the user.

So the danger of overwriting files with `copy-file' and other similar
commands still exists.

-- 
Juri Linkov
http://www.jurta.org/emacs/





reply via email to

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