Commit dd693537 authored by Eli Zaretskii's avatar Eli Zaretskii

(Fexpand_file_name) [DOS_NT]: Use the root directory

of the current drive as the fallback for default_directory.
parent 62582985
......@@ -1038,7 +1038,23 @@ See also the function `substitute-in-file-name'. */)
if (NILP (default_directory))
default_directory = current_buffer->directory;
if (! STRINGP (default_directory))
default_directory = build_string ("/");
#ifdef DOS_NT
/* "/" is not considered a root directory on DOS_NT, so using "/"
here causes an infinite recursion in, e.g., the following:
(let (default-directory)
(expand-file-name "a"))
To avoid this, we set default_directory to the root of the
current drive. */
extern char *emacs_root_dir (void);
default_directory = build_string (emacs_root_dir ());
default_directory = build_string ("/");
if (!NILP (default_directory))
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