]> git.eshelyaron.com Git - emacs.git/commitdiff
Accept nil COMMAND in tramp-sh-handle-make-process (Bug#44151)
authorMichael Albinus <michael.albinus@gmx.de>
Sat, 24 Oct 2020 12:36:34 +0000 (14:36 +0200)
committerMichael Albinus <michael.albinus@gmx.de>
Sat, 24 Oct 2020 12:36:34 +0000 (14:36 +0200)
* 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
test/lisp/net/tramp-tests.el

index 2c7c6dae755c3e299bd00c2fb68910eb544df061..e65d376effc2755c7027e0e5aa7c1902b47f99b5 100644 (file)
@@ -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))
index c894f7ddaaa92bb690dc23bf38baca47ec099aa3..02bd6138d5de68b064472636fb9df55da439cdb0 100644 (file)
@@ -4366,6 +4366,22 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'."
                (while (accept-process-output proc 0 nil t))))
            (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))))))