;; might be bound to different file name handlers, we still
;; need this.
(saved-file-name-handler-alist file-name-handler-alist)
- file-name-handler-alist
+ (inhibit-file-name-handlers
+ (cons 'file-name-non-special
+ (and (eq inhibit-file-name-operation operation)
+ inhibit-file-name-handlers)))
+ (inhibit-file-name-operation operation)
;; Some operations respect file name handlers in
;; `default-directory'. Because core function like
;; `call-process' don't care about file name handlers in
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);
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]);
(file-name-unquote temporary-file-directory))))))
(ert-deftest files-tests-file-name-non-special--subprocess ()
- "Check that Bug#25949 is fixed."
- (skip-unless (executable-find "true"))
- (let ((default-directory (file-name-quote temporary-file-directory)))
- (should (zerop (process-file "true")))
- (should (processp (start-file-process "foo" nil "true")))
- (should (zerop (shell-command "true")))))
+ "Check that Bug#25949 and Bug#48177 are fixed."
+ (skip-unless (and (executable-find "true") (file-exists-p null-device)))
+ (let ((default-directory (file-name-quote temporary-file-directory))
+ (true (file-name-quote (executable-find "true")))
+ (null (file-name-quote null-device)))
+ (should (zerop (process-file true null `((:file ,null) ,null))))
+ (should (processp (start-file-process "foo" nil true)))
+ (should (zerop (shell-command true)))
+ (should (processp (make-process :name "foo" :command `(,true))))))
(defmacro files-tests--with-advice (symbol where function &rest body)
(declare (indent 3))
(file (file-name-nondirectory tmpfile))
(nospecial-file (file-name-nondirectory nospecial)))
(should-not (string-equal file nospecial-file))
- (should-not (equal (file-name-all-completions
- nospecial-file nospecial-tempdir)
- (file-name-all-completions file tmpdir)))
+ (should (equal (file-name-all-completions nospecial-file nospecial-tempdir)
+ (file-name-all-completions file tmpdir)))
(should (equal (file-name-all-completions file nospecial-tempdir)
(file-name-all-completions file tmpdir)))
(should (equal (file-name-all-completions nospecial-file tmpdir)
(file (file-name-nondirectory tmpfile))
(nospecial-file (file-name-nondirectory nospecial)))
(should-not (string-equal file nospecial-file))
- (should-not (equal (file-name-completion nospecial-file nospecial-tempdir)
- (file-name-completion file tmpdir)))
+ (should (equal (file-name-completion nospecial-file nospecial-tempdir)
+ (file-name-completion file tmpdir)))
(should (equal (file-name-completion file nospecial-tempdir)
(file-name-completion file tmpdir)))
(should (equal (file-name-completion nospecial-file tmpdir)