summaryrefslogtreecommitdiff
path: root/src/callproc.c
diff options
context:
space:
mode:
authorMichael Albinus <michael.albinus@gmx.de>2021-05-03 16:52:18 +0200
committerMichael Albinus <michael.albinus@gmx.de>2021-05-03 16:52:18 +0200
commit824d1a57ec8e7c90b01af6665de5a114529170df (patch)
treeea59e5089edbcac57058d5c068425286a9a8aabf /src/callproc.c
parent46b7ce0e9c77da436a139a2a44fab3cb2bcc7649 (diff)
downloademacs-824d1a57ec8e7c90b01af6665de5a114529170df.tar.gz
Fix unquoting of file names in subprocesses (Bug#48177)
* lisp/files.el (file-name-non-special): Improve handling of inhibit-file-name-handlers. * src/callproc.c (Fcall_process, call_process): Unquote infile, error_file and output_file. (Bug#48177) * test/lisp/files-tests.el (files-tests-file-name-non-special--subprocess) (files-tests-file-name-non-special-file-name-all-completions) (files-tests-file-name-non-special-file-name-completion): Adapt tests.
Diffstat (limited to 'src/callproc.c')
-rw-r--r--src/callproc.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/callproc.c b/src/callproc.c
index 5aa2cbafb4c..e44e243680d 100644
--- a/src/callproc.c
+++ b/src/callproc.c
@@ -276,6 +276,9 @@ usage: (call-process PROGRAM &optional INFILE DESTINATION DISPLAY &rest ARGS) *
else
infile = build_string (NULL_DEVICE);
+ /* Remove "/:" from INFILE. */
+ infile = remove_slash_colon (infile);
+
encoded_infile = ENCODE_FILE (infile);
filefd = emacs_open (SSDATA (encoded_infile), O_RDONLY, 0);
@@ -439,9 +442,15 @@ call_process (ptrdiff_t nargs, Lisp_Object *args, int filefd,
current_dir = encode_current_directory ();
if (STRINGP (error_file))
- error_file = ENCODE_FILE (error_file);
+ {
+ error_file = remove_slash_colon (error_file);
+ error_file = ENCODE_FILE (error_file);
+ }
if (STRINGP (output_file))
- output_file = ENCODE_FILE (output_file);
+ {
+ output_file = remove_slash_colon (output_file);
+ output_file = ENCODE_FILE (output_file);
+ }
display_p = INTERACTIVE && nargs >= 4 && !NILP (args[3]);