summaryrefslogtreecommitdiff
path: root/src/callproc.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/callproc.c')
-rw-r--r--src/callproc.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/callproc.c b/src/callproc.c
index a3b7b7afa4a..fdd1ee7988c 100644
--- a/src/callproc.c
+++ b/src/callproc.c
@@ -376,9 +376,12 @@ usage: (call-process PROGRAM &optional INFILE BUFFER DISPLAY &rest ARGS) */)
GCPRO4 (infile, buffer, current_dir, error_file);
- current_dir
- = expand_and_dir_to_file (Funhandled_file_name_directory (current_dir),
- Qnil);
+ current_dir = Funhandled_file_name_directory (current_dir);
+ if (NILP (current_dir))
+ /* If the file name handler says that current_dir is unreachable, use
+ a sensible default. */
+ current_dir = build_string ("~/");
+ current_dir = expand_and_dir_to_file (current_dir, Qnil);
if (NILP (Ffile_accessible_directory_p (current_dir)))
report_file_error ("Setting current directory",
Fcons (current_buffer->directory, Qnil));