/* 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.
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))
int volatile fd_error_volatile = fd_error;
int volatile filefd_volatile = filefd;
ptrdiff_t volatile count_volatile = count;
+ ptrdiff_t volatile sa_avail_volatile = sa_avail;
ptrdiff_t volatile sa_count_volatile = sa_count;
char **volatile new_argv_volatile = new_argv;
int volatile callproc_fd_volatile[CALLPROC_FDS];
fd_error = fd_error_volatile;
filefd = filefd_volatile;
count = count_volatile;
+ sa_avail = sa_avail_volatile;
sa_count = sa_count_volatile;
new_argv = new_argv_volatile;
(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. */
/* 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: ;
#endif
temp = pwd_var + 4;
memcpy (pwd_var, "PWD=", 4);
- strcpy (temp, SSDATA (current_dir));
+ lispstpcpy (temp, current_dir);
#ifndef DOS_NT
/* We can't signal an Elisp error here; we're in a vfork. Since
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);
}