diff options
| author | Joakim Verona | 2015-01-15 14:54:25 +0100 |
|---|---|---|
| committer | Joakim Verona | 2015-01-15 14:54:25 +0100 |
| commit | 0298a2c6a10bc3b79cb2f45a1961dd7ac6da4e6d (patch) | |
| tree | 6c7ea25ac137f5764d931e841598a3c1ea434ab0 /src/callproc.c | |
| parent | a1124bc117e41019de49c82d13d1a72a50df977d (diff) | |
| parent | 0e97c44c3699c4606a04f589828acdf9c03f447e (diff) | |
| download | emacs-0298a2c6a10bc3b79cb2f45a1961dd7ac6da4e6d.tar.gz emacs-0298a2c6a10bc3b79cb2f45a1961dd7ac6da4e6d.zip | |
merge master
Diffstat (limited to 'src/callproc.c')
| -rw-r--r-- | src/callproc.c | 23 |
1 files changed, 8 insertions, 15 deletions
diff --git a/src/callproc.c b/src/callproc.c index 0fdf278073d..63ab9bf70db 100644 --- a/src/callproc.c +++ b/src/callproc.c | |||
| @@ -131,12 +131,9 @@ encode_current_directory (void) | |||
| 131 | report_file_error ("Setting current directory", | 131 | report_file_error ("Setting current directory", |
| 132 | BVAR (current_buffer, directory)); | 132 | BVAR (current_buffer, directory)); |
| 133 | 133 | ||
| 134 | /* Remove "/:" from dir. */ | 134 | /* Remove "/:" from DIR and encode it. */ |
| 135 | if (! NILP (Fstring_match (build_string ("^/:"), dir, Qnil))) | 135 | dir = ENCODE_FILE (remove_slash_colon (dir)); |
| 136 | dir = Fsubstring (dir, make_number (2), Qnil); | ||
| 137 | 136 | ||
| 138 | if (STRING_MULTIBYTE (dir)) | ||
| 139 | dir = ENCODE_FILE (dir); | ||
| 140 | if (! file_accessible_directory_p (dir)) | 137 | if (! file_accessible_directory_p (dir)) |
| 141 | report_file_error ("Setting current directory", | 138 | report_file_error ("Setting current directory", |
| 142 | BVAR (current_buffer, directory)); | 139 | BVAR (current_buffer, directory)); |
| @@ -267,7 +264,7 @@ usage: (call-process PROGRAM &optional INFILE DESTINATION DISPLAY &rest ARGS) * | |||
| 267 | infile = build_string (NULL_DEVICE); | 264 | infile = build_string (NULL_DEVICE); |
| 268 | 265 | ||
| 269 | GCPRO1 (infile); | 266 | GCPRO1 (infile); |
| 270 | encoded_infile = STRING_MULTIBYTE (infile) ? ENCODE_FILE (infile) : infile; | 267 | encoded_infile = ENCODE_FILE (infile); |
| 271 | 268 | ||
| 272 | filefd = emacs_open (SSDATA (encoded_infile), O_RDONLY, 0); | 269 | filefd = emacs_open (SSDATA (encoded_infile), O_RDONLY, 0); |
| 273 | if (filefd < 0) | 270 | if (filefd < 0) |
| @@ -439,9 +436,9 @@ call_process (ptrdiff_t nargs, Lisp_Object *args, int filefd, | |||
| 439 | 436 | ||
| 440 | GCPRO4 (buffer, current_dir, error_file, output_file); | 437 | GCPRO4 (buffer, current_dir, error_file, output_file); |
| 441 | 438 | ||
| 442 | if (STRINGP (error_file) && STRING_MULTIBYTE (error_file)) | 439 | if (STRINGP (error_file)) |
| 443 | error_file = ENCODE_FILE (error_file); | 440 | error_file = ENCODE_FILE (error_file); |
| 444 | if (STRINGP (output_file) && STRING_MULTIBYTE (output_file)) | 441 | if (STRINGP (output_file)) |
| 445 | output_file = ENCODE_FILE (output_file); | 442 | output_file = ENCODE_FILE (output_file); |
| 446 | UNGCPRO; | 443 | UNGCPRO; |
| 447 | } | 444 | } |
| @@ -468,11 +465,8 @@ call_process (ptrdiff_t nargs, Lisp_Object *args, int filefd, | |||
| 468 | report_file_error ("Searching for program", args[0]); | 465 | report_file_error ("Searching for program", args[0]); |
| 469 | } | 466 | } |
| 470 | 467 | ||
| 471 | /* If program file name starts with /: for quoting a magic name, | 468 | /* Remove "/:" from PATH. */ |
| 472 | discard that. */ | 469 | path = remove_slash_colon (path); |
| 473 | if (SBYTES (path) > 2 && SREF (path, 0) == '/' | ||
| 474 | && SREF (path, 1) == ':') | ||
| 475 | path = Fsubstring (path, make_number (2), Qnil); | ||
| 476 | 470 | ||
| 477 | SAFE_NALLOCA (new_argv, 1, nargs < 4 ? 2 : nargs - 2); | 471 | SAFE_NALLOCA (new_argv, 1, nargs < 4 ? 2 : nargs - 2); |
| 478 | 472 | ||
| @@ -498,8 +492,7 @@ call_process (ptrdiff_t nargs, Lisp_Object *args, int filefd, | |||
| 498 | } | 492 | } |
| 499 | else | 493 | else |
| 500 | new_argv[1] = 0; | 494 | new_argv[1] = 0; |
| 501 | if (STRING_MULTIBYTE (path)) | 495 | path = ENCODE_FILE (path); |
| 502 | path = ENCODE_FILE (path); | ||
| 503 | new_argv[0] = SSDATA (path); | 496 | new_argv[0] = SSDATA (path); |
| 504 | UNGCPRO; | 497 | UNGCPRO; |
| 505 | } | 498 | } |