Avoid leading tabs in shell scripts, sent by Tramp.

Fixes: debbugs:20118

* tramp-sh.el (tramp-maybe-send-script): Avoid leading tabs in
shell scripts.
This commit is contained in:
Michael Albinus 2015-03-17 20:07:38 +01:00
parent e70a1f9b42
commit 7cf5b3748c
2 changed files with 9 additions and 0 deletions

View file

@ -1,3 +1,8 @@
2015-03-17 Michael Albinus <michael.albinus@gmx.de>
* tramp-sh.el (tramp-maybe-send-script): Avoid leading tabs in
shell scripts. (Bug#20118)
2015-03-17 Eli Zaretskii <eliz@gnu.org>
* mouse.el (mouse-appearance-menu): If w32-use-w32-font-dialog is

View file

@ -3725,6 +3725,10 @@ Only send the definition if it has not already been done."
(tramp-get-connection-process vec) "scripts" nil)))
(unless (member name scripts)
(with-tramp-progress-reporter vec 5 (format "Sending script `%s'" name)
;; In bash, leading TABs like in `tramp-vc-registered-read-file-names'
;; could result in unwanted command expansion. Avoid this.
(setq script (tramp-compat-replace-regexp-in-string
(make-string 1 ?\t) (make-string 8 ? ) script))
;; The script could contain a call of Perl. This is masked with `%s'.
(when (and (string-match "%s" script)
(not (tramp-get-remote-perl vec)))