]> git.eshelyaron.com Git - emacs.git/commitdiff
Omit duplicate test of current directory
authorPaul Eggert <eggert@cs.ucla.edu>
Wed, 11 Sep 2019 21:24:03 +0000 (14:24 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Wed, 11 Sep 2019 21:24:29 +0000 (14:24 -0700)
* 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.

src/callproc.c

index b296bdb088bd62b2c91dac938e5ba0a317de7c13..4473b19a297cd8799ad2bb3c87e1a047693eaf2a 100644 (file)
@@ -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;
 }