From: Michael Albinus Date: Wed, 11 Jan 2017 16:13:41 +0000 (+0100) Subject: Support stat 8.26 in Tramp X-Git-Tag: emacs-26.0.90~912 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=3a6df2d6043d32dd9a1864c87de8d99e9739a7e4;p=emacs.git 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) --- 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)))