aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKenichi Handa2006-01-26 00:40:12 +0000
committerKenichi Handa2006-01-26 00:40:12 +0000
commit34b8768930168c1683fd5544e373de007cd0dcbf (patch)
tree0c6f626a36ce4ffb131a7ccfb48fea123c885b39 /src
parent4d92725249f77da1f5ab7311a041f2bef00ad3ca (diff)
downloademacs-34b8768930168c1683fd5544e373de007cd0dcbf.tar.gz
emacs-34b8768930168c1683fd5544e373de007cd0dcbf.zip
(Fcall_process): GCPRO error_file. Encode infile,
current_dir, and error_file. On reporting an error, decode them back.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog6
-rw-r--r--src/callproc.c22
2 files changed, 20 insertions, 8 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index f75797b56c6..001bbf23e9a 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,9 @@
12006-01-26 Kenichi Handa <handa@m17n.org>
2
3 * callproc.c (Fcall_process): GCPRO error_file. Encode infile,
4 current_dir, and error_file. On reporting an error, decode them
5 back.
6
12006-01-24 Stefan Monnier <monnier@iro.umontreal.ca> 72006-01-24 Stefan Monnier <monnier@iro.umontreal.ca>
2 8
3 * regex.c (IMMEDIATE_QUIT_CHECK): Use it with SYNC_INPUT as well. 9 * regex.c (IMMEDIATE_QUIT_CHECK): Use it with SYNC_INPUT as well.
diff --git a/src/callproc.c b/src/callproc.c
index b0fe16e70b8..3301d0849a0 100644
--- a/src/callproc.c
+++ b/src/callproc.c
@@ -355,11 +355,11 @@ usage: (call-process PROGRAM &optional INFILE BUFFER DISPLAY &rest ARGS) */)
355 protected by the caller, so all we really have to worry about is 355 protected by the caller, so all we really have to worry about is
356 buffer. */ 356 buffer. */
357 { 357 {
358 struct gcpro gcpro1, gcpro2, gcpro3; 358 struct gcpro gcpro1, gcpro2, gcpro3, gcpro4;
359 359
360 current_dir = current_buffer->directory; 360 current_dir = current_buffer->directory;
361 361
362 GCPRO3 (infile, buffer, current_dir); 362 GCPRO4 (infile, buffer, current_dir, error_file);
363 363
364 current_dir 364 current_dir
365 = expand_and_dir_to_file (Funhandled_file_name_directory (current_dir), 365 = expand_and_dir_to_file (Funhandled_file_name_directory (current_dir),
@@ -368,6 +368,12 @@ usage: (call-process PROGRAM &optional INFILE BUFFER DISPLAY &rest ARGS) */)
368 report_file_error ("Setting current directory", 368 report_file_error ("Setting current directory",
369 Fcons (current_buffer->directory, Qnil)); 369 Fcons (current_buffer->directory, Qnil));
370 370
371 if (STRING_MULTIBYTE (infile))
372 infile = ENCODE_FILE (infile);
373 if (STRING_MULTIBYTE (current_dir))
374 current_dir = ENCODE_FILE (current_dir);
375 if (STRINGP (error_file) && STRING_MULTIBYTE (error_file))
376 error_file = ENCODE_FILE (error_file);
371 UNGCPRO; 377 UNGCPRO;
372 } 378 }
373 379
@@ -376,6 +382,7 @@ usage: (call-process PROGRAM &optional INFILE BUFFER DISPLAY &rest ARGS) */)
376 filefd = emacs_open (SDATA (infile), O_RDONLY, 0); 382 filefd = emacs_open (SDATA (infile), O_RDONLY, 0);
377 if (filefd < 0) 383 if (filefd < 0)
378 { 384 {
385 infile = DECODE_FILE (infile);
379 report_file_error ("Opening process input file", Fcons (infile, Qnil)); 386 report_file_error ("Opening process input file", Fcons (infile, Qnil));
380 } 387 }
381 /* Search for program; barf if not found. */ 388 /* Search for program; barf if not found. */
@@ -533,14 +540,13 @@ usage: (call-process PROGRAM &optional INFILE BUFFER DISPLAY &rest ARGS) */)
533#ifdef MSDOS 540#ifdef MSDOS
534 unlink (tempfile); 541 unlink (tempfile);
535#endif 542#endif
536 report_file_error ("Cannot redirect stderr", 543 if (NILP (error_file))
537 Fcons ((NILP (error_file) 544 error_file = build_string (NULL_DEVICE);
538 ? build_string (NULL_DEVICE) : error_file), 545 else if (STRINGP (error_file))
539 Qnil)); 546 error_file = DECODE_FILE (error_file);
547 report_file_error ("Cannot redirect stderr", Fcons (error_file, Qnil));
540 } 548 }
541 549
542 current_dir = ENCODE_FILE (current_dir);
543
544#ifdef MAC_OS8 550#ifdef MAC_OS8
545 { 551 {
546 /* Call run_mac_command in sysdep.c here directly instead of doing 552 /* Call run_mac_command in sysdep.c here directly instead of doing