Mercurial > hg > xemacs-beta
comparison src/callproc.c @ 44:8d2a9b52c682 r19-15prefinal
Import from CVS: tag r19-15prefinal
author | cvs |
---|---|
date | Mon, 13 Aug 2007 08:55:10 +0200 |
parents | e04119814345 |
children | 56c54cf7c5b6 |
comparison
equal
deleted
inserted
replaced
43:23cafc5d2038 | 44:8d2a9b52c682 |
---|---|
182 int pid; | 182 int pid; |
183 char buf[16384]; | 183 char buf[16384]; |
184 char *bufptr = buf; | 184 char *bufptr = buf; |
185 int bufsize = 16384; | 185 int bufsize = 16384; |
186 int speccount = specpdl_depth (); | 186 int speccount = specpdl_depth (); |
187 struct gcpro gcpro1; | |
187 char **new_argv | 188 char **new_argv |
188 = (char **) alloca ((max (2, nargs - 2)) * sizeof (char *)); | 189 = (char **) alloca ((max (2, nargs - 2)) * sizeof (char *)); |
189 | 190 |
190 /* File to use for stderr in the child. | 191 /* File to use for stderr in the child. |
191 t means use same as standard output. */ | 192 t means use same as standard output. */ |
221 buffer's current directory. We can't just have the child check | 222 buffer's current directory. We can't just have the child check |
222 for an error when it does the chdir, since it's in a vfork. */ | 223 for an error when it does the chdir, since it's in a vfork. */ |
223 | 224 |
224 GCPRO2 (current_dir, path); /* Caller gcprotects args[] */ | 225 GCPRO2 (current_dir, path); /* Caller gcprotects args[] */ |
225 current_dir = current_buffer->directory; | 226 current_dir = current_buffer->directory; |
226 current_dir = expand_and_dir_to_file | 227 current_dir = Funhandled_file_name_directory (current_dir); |
227 (Funhandled_file_name_directory (current_dir), Qnil); | 228 current_dir = expand_and_dir_to_file (current_dir, Qnil); |
228 #if 0 | 229 #if 0 |
229 /* I don't know how RMS intends this crock of shit to work, but it | 230 /* I don't know how RMS intends this crock of shit to work, but it |
230 breaks everything in the presence of ange-ftp-visited files, so | 231 breaks everything in the presence of ange-ftp-visited files, so |
231 fuck it. */ | 232 fuck it. */ |
232 if (NILP (Ffile_accessible_directory_p (current_dir))) | 233 if (NILP (Ffile_accessible_directory_p (current_dir))) |
236 UNGCPRO; | 237 UNGCPRO; |
237 } | 238 } |
238 | 239 |
239 if (nargs >= 2 && ! NILP (args[1])) | 240 if (nargs >= 2 && ! NILP (args[1])) |
240 { | 241 { |
242 struct gcpro gcpro1; | |
243 GCPRO1 (current_buffer->directory); | |
241 infile = Fexpand_file_name (args[1], current_buffer->directory); | 244 infile = Fexpand_file_name (args[1], current_buffer->directory); |
245 UNGCPRO; | |
242 CHECK_STRING (infile); | 246 CHECK_STRING (infile); |
243 } | 247 } |
244 else | 248 else |
245 infile = build_string (NULL_DEVICE); | 249 infile = build_string (NULL_DEVICE); |
250 | |
251 GCPRO1 (infile); /* Fexpand_file_name might trash it */ | |
246 | 252 |
247 if (nargs >= 3) | 253 if (nargs >= 3) |
248 { | 254 { |
249 buffer = args[2]; | 255 buffer = args[2]; |
250 | 256 |
278 CHECK_BUFFER (buffer); | 284 CHECK_BUFFER (buffer); |
279 } | 285 } |
280 } | 286 } |
281 else | 287 else |
282 buffer = Qnil; | 288 buffer = Qnil; |
289 | |
290 UNGCPRO; | |
283 | 291 |
284 display = ((nargs >= 4) ? args[3] : Qnil); | 292 display = ((nargs >= 4) ? args[3] : Qnil); |
285 | 293 |
286 /* From here we assume we won't GC (unless an error is signaled). */ | 294 /* From here we assume we won't GC (unless an error is signaled). */ |
287 { | 295 { |