]> git.eshelyaron.com Git - emacs.git/commitdiff
* lisp/net/tramp-sh.el (tramp-find-executable): Fix check.
authorMichael Albinus <michael.albinus@gmx.de>
Sat, 22 Feb 2025 13:38:24 +0000 (14:38 +0100)
committerEshel Yaron <me@eshelyaron.com>
Sun, 23 Feb 2025 08:15:53 +0000 (09:15 +0100)
(cherry picked from commit e682fd2d5ba5f471a6e4d07b7f691a1ba9fa1139)

lisp/net/tramp-sh.el

index 3ced60eb0dde6f39ae3fdce7d243f0186a9e032e..080a74405d1ee374e1f0d3b96b0f64d5a74ba132 100644 (file)
@@ -4114,8 +4114,9 @@ This function expects to be in the right *tramp* buffer."
      vec (format "%s type -P %s 2>%s"
                 (if dirlist (concat "PATH=" (string-join dirlist ":")) "")
                 progname (tramp-get-remote-null-device vec)))
-    (unless (zerop (buffer-size))
-      (string-trim (buffer-string)))))
+    (goto-char (point-min))
+    (when (search-forward-regexp "/" nil 'noerror)
+      (string-trim (buffer-substring (match-beginning 0) (point-max))))))
 
 ;; On hydra.nixos.org, the $PATH environment variable is too long to
 ;; send it.  This is likely not due to PATH_MAX, but PIPE_BUF.  We