]> code.delx.au - gnu-emacs/commitdiff
tramp-sh.el: Work around a stat bug
authorMichael Albinus <michael.albinus@gmx.de>
Thu, 5 May 2016 08:23:06 +0000 (10:23 +0200)
committerMichael Albinus <michael.albinus@gmx.de>
Thu, 5 May 2016 08:23:06 +0000 (10:23 +0200)
* lisp/net/tramp-sh.el (tramp-get-remote-stat): Do not use
stat versions which produce shell quoted output.  See also
coreutils Bug#23422.

lisp/net/tramp-sh.el

index 071ec576652b2c9439f13bf826e6aa634e1f0ecc..3fb15888ca899e5d0234f4670c2c329e3abc307d 100644 (file)
@@ -5430,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)))