diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 10 | ||||
| -rw-r--r-- | src/callproc.c | 48 | ||||
| -rw-r--r-- | src/w32proc.c | 3 |
3 files changed, 39 insertions, 22 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index b4c3195973c..302010ec769 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,13 @@ | |||
| 1 | 2013-02-02 Eli Zaretskii <eliz@gnu.org> | ||
| 2 | |||
| 3 | * callproc.c (Fcall_process): Make sure program name in PATH and | ||
| 4 | new_argv[0] is encoded, if needed. Otherwise, un-encoded string | ||
| 5 | is passed to exec/spawnve, which fails unless the file-name | ||
| 6 | encoding is UTF-8. | ||
| 7 | |||
| 8 | * w32proc.c (sys_spawnve): Make sure escape_char is initialized, | ||
| 9 | even if w32-quote-process-args is nil. | ||
| 10 | |||
| 1 | 2013-02-01 Paul Eggert <eggert@cs.ucla.edu> | 11 | 2013-02-01 Paul Eggert <eggert@cs.ucla.edu> |
| 2 | 12 | ||
| 3 | Fix timestamp bug when write-region appends nothing (Bug#13149). | 13 | Fix timestamp bug when write-region appends nothing (Bug#13149). |
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 | ||
diff --git a/src/w32proc.c b/src/w32proc.c index 0fcb2993020..615e5329e8c 100644 --- a/src/w32proc.c +++ b/src/w32proc.c | |||
| @@ -1541,7 +1541,6 @@ sys_spawnve (int mode, char *cmdname, char **argv, char **envp) | |||
| 1541 | child_process *cp; | 1541 | child_process *cp; |
| 1542 | int is_dos_app, is_cygnus_app, is_gui_app; | 1542 | int is_dos_app, is_cygnus_app, is_gui_app; |
| 1543 | int do_quoting = 0; | 1543 | int do_quoting = 0; |
| 1544 | char escape_char; | ||
| 1545 | /* We pass our process ID to our children by setting up an environment | 1544 | /* We pass our process ID to our children by setting up an environment |
| 1546 | variable in their environment. */ | 1545 | variable in their environment. */ |
| 1547 | char ppid_env_var_buffer[64]; | 1546 | char ppid_env_var_buffer[64]; |
| @@ -1554,6 +1553,8 @@ sys_spawnve (int mode, char *cmdname, char **argv, char **envp) | |||
| 1554 | Some extra whitespace characters need quoting in Cygwin programs, | 1553 | Some extra whitespace characters need quoting in Cygwin programs, |
| 1555 | so this list is conditionally modified below. */ | 1554 | so this list is conditionally modified below. */ |
| 1556 | char *sepchars = " \t*?"; | 1555 | char *sepchars = " \t*?"; |
| 1556 | /* This is for native w32 apps; modified below for Cygwin apps. */ | ||
| 1557 | char escape_char = '\\'; | ||
| 1557 | 1558 | ||
| 1558 | /* We don't care about the other modes */ | 1559 | /* We don't care about the other modes */ |
| 1559 | if (mode != _P_NOWAIT) | 1560 | if (mode != _P_NOWAIT) |