aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Albinus2015-03-17 20:07:38 +0100
committerMichael Albinus2015-03-17 20:07:38 +0100
commit7cf5b3748cb1c8df5a0189bf6b5e95b550c16668 (patch)
treeef7a9b00fc36a72cfe0ee927b056f69749afdeb7
parente70a1f9b42857fa1315302b9c140a6d40ea15f1d (diff)
downloademacs-7cf5b3748cb1c8df5a0189bf6b5e95b550c16668.tar.gz
emacs-7cf5b3748cb1c8df5a0189bf6b5e95b550c16668.zip
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.
-rw-r--r--lisp/ChangeLog5
-rw-r--r--lisp/net/tramp-sh.el4
2 files changed, 9 insertions, 0 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index b734aaa39e3..cf4eeae2287 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,8 @@
12015-03-17 Michael Albinus <michael.albinus@gmx.de>
2
3 * tramp-sh.el (tramp-maybe-send-script): Avoid leading tabs in
4 shell scripts. (Bug#20118)
5
12015-03-17 Eli Zaretskii <eliz@gnu.org> 62015-03-17 Eli Zaretskii <eliz@gnu.org>
2 7
3 * mouse.el (mouse-appearance-menu): If w32-use-w32-font-dialog is 8 * mouse.el (mouse-appearance-menu): If w32-use-w32-font-dialog is
diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el
index b6c47bcb7bb..133d886f372 100644
--- a/lisp/net/tramp-sh.el
+++ b/lisp/net/tramp-sh.el
@@ -3725,6 +3725,10 @@ Only send the definition if it has not already been done."
3725 (tramp-get-connection-process vec) "scripts" nil))) 3725 (tramp-get-connection-process vec) "scripts" nil)))
3726 (unless (member name scripts) 3726 (unless (member name scripts)
3727 (with-tramp-progress-reporter vec 5 (format "Sending script `%s'" name) 3727 (with-tramp-progress-reporter vec 5 (format "Sending script `%s'" name)
3728 ;; In bash, leading TABs like in `tramp-vc-registered-read-file-names'
3729 ;; could result in unwanted command expansion. Avoid this.
3730 (setq script (tramp-compat-replace-regexp-in-string
3731 (make-string 1 ?\t) (make-string 8 ? ) script))
3728 ;; The script could contain a call of Perl. This is masked with `%s'. 3732 ;; The script could contain a call of Perl. This is masked with `%s'.
3729 (when (and (string-match "%s" script) 3733 (when (and (string-match "%s" script)
3730 (not (tramp-get-remote-perl vec))) 3734 (not (tramp-get-remote-perl vec)))