From 8b1ccf5e7bc734aa3d0de6e1906677699c7eb3b2 Mon Sep 17 00:00:00 2001 From: Michael Albinus Date: Sat, 24 Oct 2020 13:08:31 +0200 Subject: [PATCH] Fix tramp-sh-handle-make-process; don't merge with master * lisp/net/tramp-sh.el (tramp-sh-handle-make-process): Accept nil COMMAND. (Bug#44151) * test/lisp/net/tramp-tests.el (tramp-test29-start-file-process): Extend test. --- lisp/net/tramp-sh.el | 2 +- test/lisp/net/tramp-tests.el | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el index 19d50fce4c5..df6720b99b7 100644 --- a/lisp/net/tramp-sh.el +++ b/lisp/net/tramp-sh.el @@ -2822,7 +2822,7 @@ STDERR can also be a file name." (signal 'wrong-type-argument (list #'stringp name))) (unless (or (null buffer) (bufferp buffer) (stringp buffer)) (signal 'wrong-type-argument (list #'stringp buffer))) - (unless (consp command) + (unless (or (null command) (consp command)) (signal 'wrong-type-argument (list #'consp command))) (unless (or (null coding) (and (symbolp coding) (memq coding coding-system-list)) diff --git a/test/lisp/net/tramp-tests.el b/test/lisp/net/tramp-tests.el index fb4df639e5a..cc9ccefb0df 100644 --- a/test/lisp/net/tramp-tests.el +++ b/test/lisp/net/tramp-tests.el @@ -4282,6 +4282,21 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'." ;; echoes also the sent string. (should (string-match "\\`foo" (buffer-string)))) + ;; Cleanup. + (ignore-errors (delete-process proc))) + + ;; PTY. + (unwind-protect + (with-temp-buffer + (if (not (tramp--test-sh-p)) + (should-error + (start-file-process "test4" (current-buffer) nil) + :type 'wrong-type-argument) + (setq proc (start-file-process "test4" (current-buffer) nil)) + (should (processp proc)) + (should (equal (process-status proc) 'run)) + (should (stringp (process-tty-name proc))))) + ;; Cleanup. (ignore-errors (delete-process proc)))))) -- 2.39.2