From e682fd2d5ba5f471a6e4d07b7f691a1ba9fa1139 Mon Sep 17 00:00:00 2001 From: Michael Albinus Date: Sat, 22 Feb 2025 14:38:24 +0100 Subject: [PATCH] * lisp/net/tramp-sh.el (tramp-find-executable): Fix check. --- lisp/net/tramp-sh.el | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el index e008bc07301..3468ea060d7 100644 --- a/lisp/net/tramp-sh.el +++ b/lisp/net/tramp-sh.el @@ -4107,8 +4107,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