X-Git-Url: https://code.delx.au/gnu-emacs/blobdiff_plain/d5d8ca30e5f481a32414c42bcc3b5a042061ff07..7e09ef09a479731d01b1ca46e94ddadd73ac98e3:/src/callproc.c diff --git a/src/callproc.c b/src/callproc.c index e3dcc7bbcc..0fdf278073 100644 --- a/src/callproc.c +++ b/src/callproc.c @@ -1,6 +1,6 @@ /* Synchronous subprocess invocation for GNU Emacs. -Copyright (C) 1985-1988, 1993-1995, 1999-2014 Free Software Foundation, +Copyright (C) 1985-1988, 1993-1995, 1999-2015 Free Software Foundation, Inc. This file is part of GNU Emacs. @@ -127,6 +127,14 @@ encode_current_directory (void) dir = expand_and_dir_to_file (dir, Qnil); + if (NILP (Ffile_accessible_directory_p (dir))) + report_file_error ("Setting current directory", + BVAR (current_buffer, directory)); + + /* Remove "/:" from dir. */ + if (! NILP (Fstring_match (build_string ("^/:"), dir, Qnil))) + dir = Fsubstring (dir, make_number (2), Qnil); + if (STRING_MULTIBYTE (dir)) dir = ENCODE_FILE (dir); if (! file_accessible_directory_p (dir)) @@ -844,7 +852,7 @@ call_process (ptrdiff_t nargs, Lisp_Object *args, int filefd, (process_coding.dst_pos_byte + process_coding.produced), 0); - display_on_the_fly = 0; + display_on_the_fly = false; process_coding = saved_coding; carryover = nread; /* Make the above condition always fail in the future. */ @@ -876,9 +884,9 @@ call_process (ptrdiff_t nargs, Lisp_Object *args, int filefd, /* This variable might have been set to 0 for code detection. In that case, set it back to 1 because we should have already detected a coding system. */ - display_on_the_fly = 1; + display_on_the_fly = true; } - immediate_quit = 1; + immediate_quit = true; QUIT; } give_up: ; @@ -1307,13 +1315,10 @@ child_setup (int in, int out, int err, char **new_argv, bool set_pgrp, if (STRINGP (display)) { - char *vdata; - if (MAX_ALLOCA - sizeof "DISPLAY=" < SBYTES (display)) exec_failed (new_argv[0], ENOMEM); - vdata = alloca (sizeof "DISPLAY=" + SBYTES (display)); - strcpy (vdata, "DISPLAY="); - strcat (vdata, SSDATA (display)); + char *vdata = alloca (sizeof "DISPLAY=" + SBYTES (display)); + lispstpcpy (stpcpy (vdata, "DISPLAY="), display); new_env = add_env (env, new_env, vdata); }