emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master 9555330: Accept nil COMMAND in tramp-sh-handle-make-process (Bug#


From: Michael Albinus
Subject: master 9555330: Accept nil COMMAND in tramp-sh-handle-make-process (Bug#44151)
Date: Sat, 24 Oct 2020 08:36:43 -0400 (EDT)

branch: master
commit 95553309efcdbf219dc0682383172d55c65d2277
Author: Michael Albinus <michael.albinus@gmx.de>
Commit: Michael Albinus <michael.albinus@gmx.de>

    Accept nil COMMAND in tramp-sh-handle-make-process (Bug#44151)
    
    * 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 | 16 ++++++++++++++++
 2 files changed, 17 insertions(+), 1 deletion(-)

diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el
index 2c7c6da..e65d376 100644
--- a/lisp/net/tramp-sh.el
+++ b/lisp/net/tramp-sh.el
@@ -2809,7 +2809,7 @@ implementation will be used."
            (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 c894f7d..02bd613 100644
--- a/test/lisp/net/tramp-tests.el
+++ b/test/lisp/net/tramp-tests.el
@@ -4367,6 +4367,22 @@ This tests also `make-symbolic-link', `file-truename' 
and `add-name-to-file'."
            (should (string-match "foo" (buffer-string))))
 
        ;; Cleanup.
+       (ignore-errors (delete-process proc)))
+
+      ;; PTY.
+      (unwind-protect
+         (with-temp-buffer
+           ;; It works only for tramp-sh.el, and not direct async processes.
+           (if (or (not (tramp--test-sh-p)) (tramp-direct-async-process-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))))))
 
 (defmacro tramp--test--deftest-direct-async-process



reply via email to

[Prev in Thread] Current Thread [Next in Thread]