aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/callproc.c35
1 files changed, 19 insertions, 16 deletions
diff --git a/src/callproc.c b/src/callproc.c
index 04c2bdc7579..21d0f444a77 100644
--- a/src/callproc.c
+++ b/src/callproc.c
@@ -228,9 +228,9 @@ If you quit, the process is killed with SIGINT, or SIGKILL if you quit again.")
228 228
229 GCPRO3 (infile, buffer, current_dir); 229 GCPRO3 (infile, buffer, current_dir);
230 230
231 current_dir = 231 current_dir
232 expand_and_dir_to_file 232 = expand_and_dir_to_file (Funhandled_file_name_directory (current_dir),
233 (Funhandled_file_name_directory (current_dir), Qnil); 233 Qnil);
234 if (NILP (Ffile_accessible_directory_p (current_dir))) 234 if (NILP (Ffile_accessible_directory_p (current_dir)))
235 report_file_error ("Setting current directory", 235 report_file_error ("Setting current directory",
236 Fcons (current_buffer->directory, Qnil)); 236 Fcons (current_buffer->directory, Qnil));
@@ -240,31 +240,34 @@ If you quit, the process is killed with SIGINT, or SIGKILL if you quit again.")
240 240
241 display = nargs >= 4 ? args[3] : Qnil; 241 display = nargs >= 4 ? args[3] : Qnil;
242 242
243 {
244 register int i;
245 for (i = 4; i < nargs; i++)
246 {
247 CHECK_STRING (args[i], i);
248 new_argv[i - 3] = XSTRING (args[i])->data;
249 }
250 /* Program name is first command arg */
251 new_argv[0] = XSTRING (args[0])->data;
252 new_argv[i - 3] = 0;
253 }
254
255 filefd = open (XSTRING (infile)->data, O_RDONLY, 0); 243 filefd = open (XSTRING (infile)->data, O_RDONLY, 0);
256 if (filefd < 0) 244 if (filefd < 0)
257 { 245 {
258 report_file_error ("Opening process input file", Fcons (infile, Qnil)); 246 report_file_error ("Opening process input file", Fcons (infile, Qnil));
259 } 247 }
260 /* Search for program; barf if not found. */ 248 /* Search for program; barf if not found. */
261 openp (Vexec_path, args[0], EXEC_SUFFIXES, &path, 1); 249 {
250 struct gcpro gcpro1;
251
252 GCPRO1 (current_dir);
253 openp (Vexec_path, args[0], EXEC_SUFFIXES, &path, 1);
254 UNGCPRO;
255 }
262 if (NILP (path)) 256 if (NILP (path))
263 { 257 {
264 close (filefd); 258 close (filefd);
265 report_file_error ("Searching for program", Fcons (args[0], Qnil)); 259 report_file_error ("Searching for program", Fcons (args[0], Qnil));
266 } 260 }
267 new_argv[0] = XSTRING (path)->data; 261 new_argv[0] = XSTRING (path)->data;
262 {
263 register int i;
264 for (i = 4; i < nargs; i++)
265 {
266 CHECK_STRING (args[i], i);
267 new_argv[i - 3] = XSTRING (args[i])->data;
268 }
269 new_argv[i - 3] = 0;
270 }
268 271
269#ifdef MSDOS /* MW, July 1993 */ 272#ifdef MSDOS /* MW, July 1993 */
270 /* These vars record information from process termination. 273 /* These vars record information from process termination.