From ef926ce3b6a078039303ae210e599dc4d3faa13b Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Wed, 11 Sep 2019 14:24:03 -0700 Subject: [PATCH] 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. --- src/callproc.c | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/src/callproc.c b/src/callproc.c index b296bdb088b..4473b19a297 100644 --- a/src/callproc.c +++ b/src/callproc.c @@ -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; } -- 2.39.5