Commit ef926ce3 authored by Paul Eggert's avatar Paul Eggert

Omit duplicate test of current directory

* src/callproc.c (encode_current_directory): Remove redundant
call to Ffile_accessible_directory_p.  The code checks the
encoded name with file_accessible_directory_p anyway.
parent 5fafa40d
Pipeline #3102 failed with stage
in 54 minutes and 35 seconds
......@@ -108,11 +108,8 @@ static Lisp_Object call_process (ptrdiff_t, Lisp_Object *, int, ptrdiff_t);
Lisp_Object
encode_current_directory (void)
{
Lisp_Object dir;
dir = BVAR (current_buffer, directory);
dir = Funhandled_file_name_directory (dir);
Lisp_Object curdir = BVAR (current_buffer, directory);
Lisp_Object dir = Funhandled_file_name_directory (curdir);
/* If the file name handler says that dir is unreachable, use
a sensible default. */
......@@ -120,17 +117,10 @@ encode_current_directory (void)
dir = build_string ("~");
dir = expand_and_dir_to_file (dir);
if (NILP (Ffile_accessible_directory_p (dir)))
report_file_error ("Setting current directory",
BVAR (current_buffer, directory));
/* Remove "/:" from DIR and encode it. */
dir = ENCODE_FILE (remove_slash_colon (dir));
if (! file_accessible_directory_p (dir))
report_file_error ("Setting current directory",
BVAR (current_buffer, directory));
report_file_error ("Setting current directory", curdir);
return dir;
}
......
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