diff options
| author | Michael Albinus | 2018-05-11 18:38:46 +0200 |
|---|---|---|
| committer | Michael Albinus | 2018-05-11 18:38:46 +0200 |
| commit | e3d115ae86f7baa1483c5f14f1ac7d60d8aefa81 (patch) | |
| tree | fdffad3a6d42ff91b07164d24436717c83e94b60 | |
| parent | eabb6f6c3ee75dac1a7510e80bdd3c2fcfbbbcb5 (diff) | |
| download | emacs-e3d115ae86f7baa1483c5f14f1ac7d60d8aefa81.tar.gz emacs-e3d115ae86f7baa1483c5f14f1ac7d60d8aefa81.zip | |
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.
| -rw-r--r-- | lisp/net/tramp-gvfs.el | 12 | ||||
| -rw-r--r-- | test/lisp/net/tramp-tests.el | 2 |
2 files changed, 13 insertions, 1 deletions
diff --git a/lisp/net/tramp-gvfs.el b/lisp/net/tramp-gvfs.el index 199ac4fad24..a9a1a6085a4 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." | |||
| 1158 | (setq dirp (if (equal "directory" (cdr (assoc "type" attributes))) t)) | 1158 | (setq dirp (if (equal "directory" (cdr (assoc "type" attributes))) t)) |
| 1159 | (setq res-symlink-target | 1159 | (setq res-symlink-target |
| 1160 | (cdr (assoc "standard::symlink-target" attributes))) | 1160 | (cdr (assoc "standard::symlink-target" attributes))) |
| 1161 | (when (stringp res-symlink-target) | ||
| 1162 | (setq res-symlink-target | ||
| 1163 | ;; Parse unibyte codes "\xNN". We assume they are | ||
| 1164 | ;; non-ASCII codepoints in the range #x80 through #xff. | ||
| 1165 | ;; Convert them to multibyte. | ||
| 1166 | (decode-coding-string | ||
| 1167 | (replace-regexp-in-string | ||
| 1168 | "\\\\x\\([[:xdigit:]]\\{2\\}\\)" | ||
| 1169 | (lambda (x) | ||
| 1170 | (unibyte-string (string-to-number (match-string 1 x) 16))) | ||
| 1171 | res-symlink-target) | ||
| 1172 | 'utf-8))) | ||
| 1161 | ;; ... number links | 1173 | ;; ... number links |
| 1162 | (setq res-numlinks | 1174 | (setq res-numlinks |
| 1163 | (string-to-number | 1175 | (string-to-number |
diff --git a/test/lisp/net/tramp-tests.el b/test/lisp/net/tramp-tests.el index 15187efdd33..2c0b3199be6 100644 --- a/test/lisp/net/tramp-tests.el +++ b/test/lisp/net/tramp-tests.el | |||
| @@ -4716,7 +4716,7 @@ Use the `ls' command." | |||
| 4716 | (and | 4716 | (and |
| 4717 | (stringp (setq x (eval (get-language-info (car x) 'sample-text)))) | 4717 | (stringp (setq x (eval (get-language-info (car x) 'sample-text)))) |
| 4718 | (not (unencodable-char-position | 4718 | (not (unencodable-char-position |
| 4719 | 0 nil file-name-coding-system nil x)) | 4719 | 0 (length x) file-name-coding-system nil x)) |
| 4720 | ;; ?\n and ?/ shouldn't be part of any file name. ?\t, | 4720 | ;; ?\n and ?/ shouldn't be part of any file name. ?\t, |
| 4721 | ;; ?. and ?? do not work for "smb" method. | 4721 | ;; ?. and ?? do not work for "smb" method. |
| 4722 | (replace-regexp-in-string "[\t\n/.?]" "" x))) | 4722 | (replace-regexp-in-string "[\t\n/.?]" "" x))) |