Commit c4f2d8d4 authored by Lars Magne Ingebrigtsen's avatar Lars Magne Ingebrigtsen
Browse files

* fileio.c (barf_or_query_if_file_exists): Check first if the file

is a directory before asking whether to use the file name
(bug#7564).
parent c1e57b47
2011-07-04 Lars Magne Ingebrigtsen <larsi@gnus.org>
* fileio.c (barf_or_query_if_file_exists): Check first if the file
is a directory before asking whether to use the file name
(bug#7564).
* fns.c (Frequire): Remove the mention of the .gz files, since
that's installation-specific, but keep the mention of
`get-load-suffixes'.
......
......@@ -1755,6 +1755,10 @@ barf_or_query_if_file_exists (Lisp_Object absname, const char *querystring,
regardless of what access permissions it has. */
if (lstat (SSDATA (encoded_filename), &statbuf) >= 0)
{
if (Ffile_directory_p (absname))
xsignal2 (Qfile_error,
build_string ("File name is a directory"), absname);
if (! interactive)
xsignal2 (Qfile_already_exists,
build_string ("File already exists"), absname);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment