diff options
author | Michael Albinus <michael.albinus@gmx.de> | 2017-01-11 17:13:41 +0100 |
---|---|---|
committer | Michael Albinus <michael.albinus@gmx.de> | 2017-01-11 17:13:41 +0100 |
commit | 3a6df2d6043d32dd9a1864c87de8d99e9739a7e4 (patch) | |
tree | b24c77e4fc5fb5c81994994bba4ff00860e59f23 /lisp/net | |
parent | fa0a2b4e7c81f57aecc1d94df00588a4dd5c281d (diff) | |
download | emacs-3a6df2d6043d32dd9a1864c87de8d99e9739a7e4.tar.gz |
Support stat 8.26 in Tramp
* lisp/net/tramp-sh.el (tramp-get-remote-stat): Use QUOTING_STYLE
environment variable of newer coreutils. (Bug#23422)
Diffstat (limited to 'lisp/net')
-rw-r--r-- | lisp/net/tramp-sh.el | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el index 71a388767d0..a3641c6c401 100644 --- a/lisp/net/tramp-sh.el +++ b/lisp/net/tramp-sh.el @@ -5357,12 +5357,14 @@ Nonexistent directories are removed from spec." ;; 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. + ;; Since GNU stat 8.26, environment variable QUOTING_STYLE is + ;; supported. (when result - (setq tmp - (tramp-send-command-and-read - vec (format "%s -c '(\"%%N\" %%s)' /" result) 'noerror)) + (setq result (concat "env QUOTING_STYLE=locale " result) + 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))) |