]> code.delx.au - gnu-emacs/blobdiff - lisp/net/tramp-sh.el
Merge from origin/emacs-25
[gnu-emacs] / lisp / net / tramp-sh.el
index 402e1cc333272485a5ec920febe7d013db20940f..3fb15888ca899e5d0234f4670c2c329e3abc307d 100644 (file)
@@ -117,7 +117,7 @@ detected as prompt when being sent on echoing hosts, therefore.")
   "Which ssh Control* arguments to use.
 
 If it is a string, it should have the form
-\"-o ControlMaster=auto -o ControlPath='tramp.%%r@%%h:%%p'
+\"-o ControlMaster=auto -o ControlPath=\\='tramp.%%r@%%h:%%p\\='
 -o ControlPersist=no\".  Percent characters in the ControlPath
 spec must be doubled, because the string is used as format string.
 
@@ -4772,7 +4772,7 @@ connection if a previous connection has died for some reason."
              (when (and p (processp p))
                (delete-process p))
              (setenv "TERM" tramp-terminal-type)
-             (setenv "LC_ALL" "en_US.utf8")
+             (setenv "LC_ALL" (tramp-get-local-locale vec))
              (if (stringp tramp-histfile-override)
                  (setenv "HISTFILE" tramp-histfile-override)
                (if tramp-histfile-override
@@ -4782,6 +4782,8 @@ connection if a previous connection has died for some reason."
                      (setenv "HISTSIZE" "0"))))
              (setenv "PROMPT_COMMAND")
              (setenv "PS1" tramp-initial-end-of-output)
+              (unless (stringp tramp-encoding-shell)
+                (tramp-error vec 'file-error "`tramp-encoding-shell' not set"))
              (let* ((target-alist (tramp-compute-multi-hops vec))
                     ;; We will apply `tramp-ssh-controlmaster-options'
                     ;; only for the first hop.
@@ -5428,13 +5430,15 @@ Return ATTR."
                   vec "stat" (tramp-get-remote-path vec)))
          tmp)
       ;; Check whether stat(1) returns usable syntax.  "%s" does not
-      ;; work on older AIX systems.
+      ;; work on older AIX systems.  Recent GNU stat versions (8.24?)
+      ;; use shell quoted format for "%N", we check the boundaries "`"
+      ;; and "'", therefore.  See Bug#23422 in coreutils.
       (when result
        (setq tmp
              (tramp-send-command-and-read
               vec (format "%s -c '(\"%%N\" %%s)' /" result) 'noerror))
        (unless (and (listp tmp) (stringp (car tmp))
-                    (string-match "^./.$" (car tmp))
+                    (string-match "^`/'$" (car tmp))
                     (integerp (cadr tmp)))
          (setq result nil)))
       result)))