comparison src/callproc.c @ 116:9f59509498e1 r20-1b10

Import from CVS: tag r20-1b10
author cvs
date Mon, 13 Aug 2007 09:23:06 +0200
parents fe104dbd9147
children cca96a509cfe
comparison
equal deleted inserted replaced
115:f109f7dabbe2 116:9f59509498e1
188 int pid; 188 int pid;
189 char buf[16384]; 189 char buf[16384];
190 char *bufptr = buf; 190 char *bufptr = buf;
191 int bufsize = 16384; 191 int bufsize = 16384;
192 int speccount = specpdl_depth (); 192 int speccount = specpdl_depth ();
193 struct gcpro gcpro1;
193 char **new_argv 194 char **new_argv
194 = (char **) alloca ((max (2, nargs - 2)) * sizeof (char *)); 195 = (char **) alloca ((max (2, nargs - 2)) * sizeof (char *));
195 196
196 /* File to use for stderr in the child. 197 /* File to use for stderr in the child.
197 t means use same as standard output. */ 198 t means use same as standard output. */
227 buffer's current directory. We can't just have the child check 228 buffer's current directory. We can't just have the child check
228 for an error when it does the chdir, since it's in a vfork. */ 229 for an error when it does the chdir, since it's in a vfork. */
229 230
230 GCPRO2 (current_dir, path); /* Caller gcprotects args[] */ 231 GCPRO2 (current_dir, path); /* Caller gcprotects args[] */
231 current_dir = current_buffer->directory; 232 current_dir = current_buffer->directory;
232 current_dir = expand_and_dir_to_file 233 current_dir = Funhandled_file_name_directory (current_dir);
233 (Funhandled_file_name_directory (current_dir), Qnil); 234 current_dir = expand_and_dir_to_file (current_dir, Qnil);
234 #if 0 235 #if 0
235 /* I don't know how RMS intends this crock of shit to work, but it 236 /* I don't know how RMS intends this crock of shit to work, but it
236 breaks everything in the presence of ange-ftp-visited files, so 237 breaks everything in the presence of ange-ftp-visited files, so
237 fuck it. */ 238 fuck it. */
238 if (NILP (Ffile_accessible_directory_p (current_dir))) 239 if (NILP (Ffile_accessible_directory_p (current_dir)))
242 UNGCPRO; 243 UNGCPRO;
243 } 244 }
244 245
245 if (nargs >= 2 && ! NILP (args[1])) 246 if (nargs >= 2 && ! NILP (args[1]))
246 { 247 {
248 struct gcpro gcpro1;
249 GCPRO1 (current_buffer->directory);
247 infile = Fexpand_file_name (args[1], current_buffer->directory); 250 infile = Fexpand_file_name (args[1], current_buffer->directory);
251 UNGCPRO;
248 CHECK_STRING (infile); 252 CHECK_STRING (infile);
249 } 253 }
250 else 254 else
251 infile = build_string (NULL_DEVICE); 255 infile = build_string (NULL_DEVICE);
256
257 GCPRO1 (infile); /* Fexpand_file_name might trash it */
252 258
253 if (nargs >= 3) 259 if (nargs >= 3)
254 { 260 {
255 buffer = args[2]; 261 buffer = args[2];
256 262
284 CHECK_BUFFER (buffer); 290 CHECK_BUFFER (buffer);
285 } 291 }
286 } 292 }
287 else 293 else
288 buffer = Qnil; 294 buffer = Qnil;
295
296 UNGCPRO;
289 297
290 display = ((nargs >= 4) ? args[3] : Qnil); 298 display = ((nargs >= 4) ? args[3] : Qnil);
291 299
292 /* From here we assume we won't GC (unless an error is signaled). */ 300 /* From here we assume we won't GC (unless an error is signaled). */
293 { 301 {