]> git.eshelyaron.com Git - emacs.git/commitdiff
Backport: Make a more robust check in Tramp using scripts
authorMichael Albinus <michael.albinus@gmx.de>
Tue, 7 Dec 2021 15:20:13 +0000 (16:20 +0100)
committerMichael Albinus <michael.albinus@gmx.de>
Wed, 8 Dec 2021 08:30:36 +0000 (09:30 +0100)
* lisp/net/tramp-sh.el (tramp-find-inline-encoding):
Check, whether scripts in `tramp-remote-coding-commands' are
expandable.

(cherry picked from commit 1d0a60113fd155c77ef5ea4ea44fcba3504adcbf)

lisp/net/tramp-sh.el

index 6f3b3245225e6122bb7a17ef336972fe4d236557..21217381f14556dff7f8149e6bbc178ebc1f2cb9 100644 (file)
@@ -4585,6 +4585,8 @@ Goes through the list `tramp-local-coding-commands' and
                          (value (symbol-value rem-enc)))
                      (while (string-match "-" name)
                        (setq name (replace-match "_" nil t name)))
+                     (unless (tramp-expand-script vec value)
+                       (throw 'wont-work-remote nil))
                      (tramp-maybe-send-script vec value name)
                      (setq rem-enc name)))
                  (tramp-message
@@ -4602,6 +4604,8 @@ Goes through the list `tramp-local-coding-commands' and
                          (value (symbol-value rem-dec)))
                      (while (string-match "-" name)
                        (setq name (replace-match "_" nil t name)))
+                     (unless (tramp-expand-script vec value)
+                       (throw 'wont-work-remote nil))
                      (tramp-maybe-send-script vec value name)
                      (setq rem-dec name)))
                  (tramp-message