diff options
| author | Glenn Morris | 2013-02-01 19:38:21 -0800 |
|---|---|---|
| committer | Glenn Morris | 2013-02-01 19:38:21 -0800 |
| commit | 94fbc901707d7c1fd7ec0471d288e585caf59b34 (patch) | |
| tree | 6d1d48970b231f2ccd2f7c36e4c7298302c00e93 /src/callproc.c | |
| parent | 98da8c0f542465341b930d36db8000b5bb2c77c4 (diff) | |
| parent | 13841bfcc20881a268e3c853f65312390c589700 (diff) | |
| download | emacs-94fbc901707d7c1fd7ec0471d288e585caf59b34.tar.gz emacs-94fbc901707d7c1fd7ec0471d288e585caf59b34.zip | |
Merge from emacs-24; up to 2012-12-13T09:45:54Z!lekktu@gmail.com
Diffstat (limited to 'src/callproc.c')
| -rw-r--r-- | src/callproc.c | 48 |
1 files changed, 27 insertions, 21 deletions
diff --git a/src/callproc.c b/src/callproc.c index 5eba3271358..9d81bb18295 100644 --- a/src/callproc.c +++ b/src/callproc.c | |||
| @@ -445,28 +445,34 @@ usage: (call-process PROGRAM &optional INFILE BUFFER DISPLAY &rest ARGS) */) | |||
| 445 | path = Fsubstring (path, make_number (2), Qnil); | 445 | path = Fsubstring (path, make_number (2), Qnil); |
| 446 | 446 | ||
| 447 | new_argv = SAFE_ALLOCA ((nargs > 4 ? nargs - 2 : 2) * sizeof *new_argv); | 447 | new_argv = SAFE_ALLOCA ((nargs > 4 ? nargs - 2 : 2) * sizeof *new_argv); |
| 448 | if (nargs > 4) | ||
| 449 | { | ||
| 450 | ptrdiff_t i; | ||
| 451 | struct gcpro gcpro1, gcpro2, gcpro3, gcpro4, gcpro5; | ||
| 452 | 448 | ||
| 453 | GCPRO5 (infile, buffer, current_dir, path, error_file); | 449 | { |
| 454 | argument_coding.dst_multibyte = 0; | 450 | struct gcpro gcpro1, gcpro2, gcpro3, gcpro4, gcpro5; |
| 455 | for (i = 4; i < nargs; i++) | 451 | |
| 456 | { | 452 | GCPRO5 (infile, buffer, current_dir, path, error_file); |
| 457 | argument_coding.src_multibyte = STRING_MULTIBYTE (args[i]); | 453 | if (nargs > 4) |
| 458 | if (CODING_REQUIRE_ENCODING (&argument_coding)) | 454 | { |
| 459 | /* We must encode this argument. */ | 455 | ptrdiff_t i; |
| 460 | args[i] = encode_coding_string (&argument_coding, args[i], 1); | 456 | |
| 461 | } | 457 | argument_coding.dst_multibyte = 0; |
| 462 | UNGCPRO; | 458 | for (i = 4; i < nargs; i++) |
| 463 | for (i = 4; i < nargs; i++) | 459 | { |
| 464 | new_argv[i - 3] = SSDATA (args[i]); | 460 | argument_coding.src_multibyte = STRING_MULTIBYTE (args[i]); |
| 465 | new_argv[i - 3] = 0; | 461 | if (CODING_REQUIRE_ENCODING (&argument_coding)) |
| 466 | } | 462 | /* We must encode this argument. */ |
| 467 | else | 463 | args[i] = encode_coding_string (&argument_coding, args[i], 1); |
| 468 | new_argv[1] = 0; | 464 | } |
| 469 | new_argv[0] = SSDATA (path); | 465 | for (i = 4; i < nargs; i++) |
| 466 | new_argv[i - 3] = SSDATA (args[i]); | ||
| 467 | new_argv[i - 3] = 0; | ||
| 468 | } | ||
| 469 | else | ||
| 470 | new_argv[1] = 0; | ||
| 471 | if (STRING_MULTIBYTE (path)) | ||
| 472 | path = ENCODE_FILE (path); | ||
| 473 | new_argv[0] = SSDATA (path); | ||
| 474 | UNGCPRO; | ||
| 475 | } | ||
| 470 | 476 | ||
| 471 | #ifdef MSDOS /* MW, July 1993 */ | 477 | #ifdef MSDOS /* MW, July 1993 */ |
| 472 | 478 | ||