[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] master e3d115a: Tramp updates
From: |
Michael Albinus |
Subject: |
[Emacs-diffs] master e3d115a: Tramp updates |
Date: |
Fri, 11 May 2018 12:39:10 -0400 (EDT) |
branch: master
commit e3d115ae86f7baa1483c5f14f1ac7d60d8aefa81
Author: Michael Albinus <address@hidden>
Commit: Michael Albinus <address@hidden>
Tramp updates
* lisp/net/tramp-gvfs.el (tramp-gvfs-handle-file-attributes):
Parse multibyte symlinks correctly.
* test/lisp/net/tramp/tramp-tests.el (tramp--test-utf8):
Improve backward compatibility.
---
lisp/net/tramp-gvfs.el | 12 ++++++++++++
test/lisp/net/tramp-tests.el | 2 +-
2 files changed, 13 insertions(+), 1 deletion(-)
diff --git a/lisp/net/tramp-gvfs.el b/lisp/net/tramp-gvfs.el
index 199ac4f..a9a1a60 100644
--- a/lisp/net/tramp-gvfs.el
+++ b/lisp/net/tramp-gvfs.el
@@ -1158,6 +1158,18 @@ If FILE-SYSTEM is non-nil, return file system
attributes."
(setq dirp (if (equal "directory" (cdr (assoc "type" attributes))) t))
(setq res-symlink-target
(cdr (assoc "standard::symlink-target" attributes)))
+ (when (stringp res-symlink-target)
+ (setq res-symlink-target
+ ;; Parse unibyte codes "\xNN". We assume they are
+ ;; non-ASCII codepoints in the range #x80 through #xff.
+ ;; Convert them to multibyte.
+ (decode-coding-string
+ (replace-regexp-in-string
+ "\\\\x\\([[:xdigit:]]\\{2\\}\\)"
+ (lambda (x)
+ (unibyte-string (string-to-number (match-string 1 x) 16)))
+ res-symlink-target)
+ 'utf-8)))
;; ... number links
(setq res-numlinks
(string-to-number
diff --git a/test/lisp/net/tramp-tests.el b/test/lisp/net/tramp-tests.el
index 15187ef..2c0b319 100644
--- a/test/lisp/net/tramp-tests.el
+++ b/test/lisp/net/tramp-tests.el
@@ -4716,7 +4716,7 @@ Use the `ls' command."
(and
(stringp (setq x (eval (get-language-info (car x) 'sample-text))))
(not (unencodable-char-position
- 0 nil file-name-coding-system nil x))
+ 0 (length x) file-name-coding-system nil x))
;; ?\n and ?/ shouldn't be part of any file name. ?\t,
;; ?. and ?? do not work for "smb" method.
(replace-regexp-in-string "[\t\n/.?]" "" x)))
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] master e3d115a: Tramp updates,
Michael Albinus <=