summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Albinus <michael.albinus@gmx.de>2016-05-05 10:23:06 +0200
committerMichael Albinus <michael.albinus@gmx.de>2016-05-06 08:13:08 +0200
commitc760a600da6dbfa495613aa5042ab073b9490c85 (patch)
tree8cd895bd69f5f45a04276c8e4f6d6b2b90f3c592
parent50650cb6887d99b01eeb1e686fc1f695c2a0c64a (diff)
downloademacs-c760a600da6dbfa495613aa5042ab073b9490c85.tar.gz
tramp-sh.el: Work around a stat bug (backport from master)
* lisp/net/tramp-sh.el (tramp-get-remote-stat): Do not use stat versions which produce shell quoted output. See also coreutils Bug#23422. (cherry picked from commit 6aad36ace9953b9672b13be68416d205532d5e59)
-rw-r--r--lisp/net/tramp-sh.el6
1 files changed, 4 insertions, 2 deletions
diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el
index 4d529f7aa32..bff6ec31156 100644
--- a/lisp/net/tramp-sh.el
+++ b/lisp/net/tramp-sh.el
@@ -5522,13 +5522,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)))