diff options
| author | Michael Albinus | 2016-12-09 19:54:20 +0100 |
|---|---|---|
| committer | Michael Albinus | 2016-12-09 19:54:20 +0100 |
| commit | fc0fd24c105bde4c001ebebe4b8b7e1f96cd2871 (patch) | |
| tree | 829cee069c4c5a07e2c976f00899f9809f4c278e | |
| parent | 57a77f833e37abe2f7936585e9915b6947e3564a (diff) | |
| download | emacs-fc0fd24c105bde4c001ebebe4b8b7e1f96cd2871.tar.gz emacs-fc0fd24c105bde4c001ebebe4b8b7e1f96cd2871.zip | |
Fix further problems with quoted file names in Tramp
* lisp/net/tramp.el (tramp-quoted-name-p, tramp-quote-name)
(tramp-unquote-name): Move defsubst ...
* lisp/net/tramp-compat.el (tramp-compat-file-name-quoted-p)
(tramp-compat-file-name-quote)
(tramp-compat-file-name-unquote): ... here. Adapt callees.
* lisp/net/tramp-cache.el (tramp-flush-file-property)
(tramp-flush-directory-property):
* lisp/net/tramp-gvfs.el (tramp-gvfs-url-file-name):
* lisp/net/tramp-sh.el (tramp-make-copy-program-file-name):
* lisp/net/tramp-smb.el (tramp-smb-handle-copy-file)
(tramp-smb-handle-substitute-in-file-name)
(tramp-smb-get-share, tramp-smb-get-localname): Handle quoted files.
| -rw-r--r-- | lisp/net/tramp-cache.el | 24 | ||||
| -rw-r--r-- | lisp/net/tramp-compat.el | 31 | ||||
| -rw-r--r-- | lisp/net/tramp-gvfs.el | 1 | ||||
| -rw-r--r-- | lisp/net/tramp-sh.el | 14 | ||||
| -rw-r--r-- | lisp/net/tramp-smb.el | 30 | ||||
| -rw-r--r-- | lisp/net/tramp.el | 27 | ||||
| -rw-r--r-- | test/lisp/net/tramp-tests.el | 14 |
7 files changed, 81 insertions, 60 deletions
diff --git a/lisp/net/tramp-cache.el b/lisp/net/tramp-cache.el index 531044fddfd..0d90017651b 100644 --- a/lisp/net/tramp-cache.el +++ b/lisp/net/tramp-cache.el | |||
| @@ -107,6 +107,7 @@ matching entries of `tramp-connection-properties'." | |||
| 107 | "Get the PROPERTY of FILE from the cache context of KEY. | 107 | "Get the PROPERTY of FILE from the cache context of KEY. |
| 108 | Returns DEFAULT if not set." | 108 | Returns DEFAULT if not set." |
| 109 | ;; Unify localname. Remove hop from vector. | 109 | ;; Unify localname. Remove hop from vector. |
| 110 | (setq file (tramp-compat-file-name-unquote file)) | ||
| 110 | (setq key (copy-sequence key)) | 111 | (setq key (copy-sequence key)) |
| 111 | (aset key 3 (tramp-run-real-handler 'directory-file-name (list file))) | 112 | (aset key 3 (tramp-run-real-handler 'directory-file-name (list file))) |
| 112 | (aset key 4 nil) | 113 | (aset key 4 nil) |
| @@ -140,6 +141,7 @@ Returns DEFAULT if not set." | |||
| 140 | "Set the PROPERTY of FILE to VALUE, in the cache context of KEY. | 141 | "Set the PROPERTY of FILE to VALUE, in the cache context of KEY. |
| 141 | Returns VALUE." | 142 | Returns VALUE." |
| 142 | ;; Unify localname. Remove hop from vector. | 143 | ;; Unify localname. Remove hop from vector. |
| 144 | (setq file (tramp-compat-file-name-unquote file)) | ||
| 143 | (setq key (copy-sequence key)) | 145 | (setq key (copy-sequence key)) |
| 144 | (aset key 3 (tramp-run-real-handler 'directory-file-name (list file))) | 146 | (aset key 3 (tramp-run-real-handler 'directory-file-name (list file))) |
| 145 | (aset key 4 nil) | 147 | (aset key 4 nil) |
| @@ -159,28 +161,26 @@ Returns VALUE." | |||
| 159 | (let* ((file (tramp-run-real-handler | 161 | (let* ((file (tramp-run-real-handler |
| 160 | 'directory-file-name (list file))) | 162 | 'directory-file-name (list file))) |
| 161 | (truename (tramp-get-file-property key file "file-truename" nil))) | 163 | (truename (tramp-get-file-property key file "file-truename" nil))) |
| 162 | ;; Remove file properties of symlinks. | ||
| 163 | (when (and (stringp truename) | ||
| 164 | (not (string-equal file (directory-file-name truename)))) | ||
| 165 | (tramp-flush-file-property key truename)) | ||
| 166 | ;; Unify localname. Remove hop from vector. | 164 | ;; Unify localname. Remove hop from vector. |
| 165 | (setq file (tramp-compat-file-name-unquote file)) | ||
| 167 | (setq key (copy-sequence key)) | 166 | (setq key (copy-sequence key)) |
| 168 | (aset key 3 file) | 167 | (aset key 3 file) |
| 169 | (aset key 4 nil) | 168 | (aset key 4 nil) |
| 170 | (tramp-message key 8 "%s" file) | 169 | (tramp-message key 8 "%s" file) |
| 171 | (remhash key tramp-cache-data))) | 170 | (remhash key tramp-cache-data) |
| 171 | ;; Remove file properties of symlinks. | ||
| 172 | (when (and (stringp truename) | ||
| 173 | (not (string-equal file (directory-file-name truename)))) | ||
| 174 | (tramp-flush-file-property key truename)))) | ||
| 172 | 175 | ||
| 173 | ;;;###tramp-autoload | 176 | ;;;###tramp-autoload |
| 174 | (defun tramp-flush-directory-property (key directory) | 177 | (defun tramp-flush-directory-property (key directory) |
| 175 | "Remove all properties of DIRECTORY in the cache context of KEY. | 178 | "Remove all properties of DIRECTORY in the cache context of KEY. |
| 176 | Remove also properties of all files in subdirectories." | 179 | Remove also properties of all files in subdirectories." |
| 180 | (setq directory (tramp-compat-file-name-unquote directory)) | ||
| 177 | (let* ((directory (tramp-run-real-handler | 181 | (let* ((directory (tramp-run-real-handler |
| 178 | 'directory-file-name (list directory))) | 182 | 'directory-file-name (list directory))) |
| 179 | (truename (tramp-get-file-property key directory "file-truename" nil))) | 183 | (truename (tramp-get-file-property key directory "file-truename" nil))) |
| 180 | ;; Remove file properties of symlinks. | ||
| 181 | (when (and (stringp truename) | ||
| 182 | (not (string-equal directory (directory-file-name truename)))) | ||
| 183 | (tramp-flush-directory-property key truename)) | ||
| 184 | (tramp-message key 8 "%s" directory) | 184 | (tramp-message key 8 "%s" directory) |
| 185 | (maphash | 185 | (maphash |
| 186 | (lambda (key _value) | 186 | (lambda (key _value) |
| @@ -188,7 +188,11 @@ Remove also properties of all files in subdirectories." | |||
| 188 | (string-match (regexp-quote directory) | 188 | (string-match (regexp-quote directory) |
| 189 | (tramp-file-name-localname key))) | 189 | (tramp-file-name-localname key))) |
| 190 | (remhash key tramp-cache-data))) | 190 | (remhash key tramp-cache-data))) |
| 191 | tramp-cache-data))) | 191 | tramp-cache-data) |
| 192 | ;; Remove file properties of symlinks. | ||
| 193 | (when (and (stringp truename) | ||
| 194 | (not (string-equal directory (directory-file-name truename)))) | ||
| 195 | (tramp-flush-directory-property key truename)))) | ||
| 192 | 196 | ||
| 193 | ;; Reverting or killing a buffer should also flush file properties. | 197 | ;; Reverting or killing a buffer should also flush file properties. |
| 194 | ;; They could have been changed outside Tramp. In eshell, "ls" would | 198 | ;; They could have been changed outside Tramp. In eshell, "ls" would |
diff --git a/lisp/net/tramp-compat.el b/lisp/net/tramp-compat.el index a079b670641..9f1c64dd100 100644 --- a/lisp/net/tramp-compat.el +++ b/lisp/net/tramp-compat.el | |||
| @@ -347,6 +347,37 @@ This is a string of ten letters or dashes as in ls -l." | |||
| 347 | (unload-feature 'tramp-loaddefs 'force) | 347 | (unload-feature 'tramp-loaddefs 'force) |
| 348 | (unload-feature 'tramp-compat 'force))) | 348 | (unload-feature 'tramp-compat 'force))) |
| 349 | 349 | ||
| 350 | ;; `file-name-quoted-p', `file-name-quote' and `file-name-unquote' are | ||
| 351 | ;; introduced in Emacs 26. | ||
| 352 | (if (fboundp 'file-name-quoted-p) | ||
| 353 | (defalias 'tramp-compat-file-name-quoted-p 'file-name-quoted-p) | ||
| 354 | (defsubst tramp-compat-file-name-quoted-p (name) | ||
| 355 | "Whether NAME is quoted with prefix \"/:\". | ||
| 356 | If NAME is a remote file name, check the local part of NAME." | ||
| 357 | (string-match "^/:" (or (file-remote-p name 'localname) name)))) | ||
| 358 | |||
| 359 | (if (fboundp 'file-name-quote) | ||
| 360 | (defalias 'tramp-compat-file-name-quote 'file-name-quote) | ||
| 361 | (defsubst tramp-compat-file-name-quote (name) | ||
| 362 | "Add the quotation prefix \"/:\" to file NAME. | ||
| 363 | If NAME is a remote file name, the local part of NAME is quoted." | ||
| 364 | (concat | ||
| 365 | (file-remote-p name) "/:" (or (file-remote-p name 'localname) name)))) | ||
| 366 | |||
| 367 | (if (fboundp 'file-name-unquote) | ||
| 368 | (defalias 'tramp-compat-file-name-unquote 'file-name-unquote) | ||
| 369 | (defsubst tramp-compat-file-name-unquote (name) | ||
| 370 | "Remove quotation prefix \"/:\" from file NAME. | ||
| 371 | If NAME is a remote file name, the local part of NAME is unquoted." | ||
| 372 | (save-match-data | ||
| 373 | (let ((localname (or (file-remote-p name 'localname) name))) | ||
| 374 | (when (tramp-compat-file-name-quoted-p localname) | ||
| 375 | (setq | ||
| 376 | localname | ||
| 377 | (replace-match | ||
| 378 | (if (= (length localname) 2) "/" "") nil t localname))) | ||
| 379 | (concat (file-remote-p name) localname))))) | ||
| 380 | |||
| 350 | (provide 'tramp-compat) | 381 | (provide 'tramp-compat) |
| 351 | 382 | ||
| 352 | ;;; TODO: | 383 | ;;; TODO: |
diff --git a/lisp/net/tramp-gvfs.el b/lisp/net/tramp-gvfs.el index d87de467c67..46f252306ec 100644 --- a/lisp/net/tramp-gvfs.el +++ b/lisp/net/tramp-gvfs.el | |||
| @@ -1232,6 +1232,7 @@ file-notify events." | |||
| 1232 | (defun tramp-gvfs-url-file-name (filename) | 1232 | (defun tramp-gvfs-url-file-name (filename) |
| 1233 | "Return FILENAME in URL syntax." | 1233 | "Return FILENAME in URL syntax." |
| 1234 | ;; "/" must NOT be hexlified. | 1234 | ;; "/" must NOT be hexlified. |
| 1235 | (setq filename (tramp-compat-file-name-unquote filename)) | ||
| 1235 | (let ((url-unreserved-chars (cons ?/ url-unreserved-chars)) | 1236 | (let ((url-unreserved-chars (cons ?/ url-unreserved-chars)) |
| 1236 | result) | 1237 | result) |
| 1237 | (setq | 1238 | (setq |
diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el index a2949f1f204..52746f680bd 100644 --- a/lisp/net/tramp-sh.el +++ b/lisp/net/tramp-sh.el | |||
| @@ -1147,8 +1147,8 @@ target of the symlink differ." | |||
| 1147 | method user host | 1147 | method user host |
| 1148 | (with-tramp-file-property v localname "file-truename" | 1148 | (with-tramp-file-property v localname "file-truename" |
| 1149 | (let ((result nil) ; result steps in reverse order | 1149 | (let ((result nil) ; result steps in reverse order |
| 1150 | (quoted (tramp-quoted-name-p localname)) | 1150 | (quoted (tramp-compat-file-name-quoted-p localname)) |
| 1151 | (localname (tramp-unquote-name localname))) | 1151 | (localname (tramp-compat-file-name-unquote localname))) |
| 1152 | (tramp-message v 4 "Finding true name for `%s'" filename) | 1152 | (tramp-message v 4 "Finding true name for `%s'" filename) |
| 1153 | (cond | 1153 | (cond |
| 1154 | ;; Use GNU readlink --canonicalize-missing where available. | 1154 | ;; Use GNU readlink --canonicalize-missing where available. |
| @@ -1243,7 +1243,7 @@ target of the symlink differ." | |||
| 1243 | (when (string= "" result) | 1243 | (when (string= "" result) |
| 1244 | (setq result "/"))))) | 1244 | (setq result "/"))))) |
| 1245 | 1245 | ||
| 1246 | (when quoted (setq result (tramp-quote-name result))) | 1246 | (when quoted (setq result (tramp-compat-file-name-quote result))) |
| 1247 | (tramp-message v 4 "True name of `%s' is `%s'" localname result) | 1247 | (tramp-message v 4 "True name of `%s' is `%s'" localname result) |
| 1248 | result)))) | 1248 | result)))) |
| 1249 | 1249 | ||
| @@ -5166,7 +5166,8 @@ Return ATTR." | |||
| 5166 | (let ((method (tramp-file-name-method vec)) | 5166 | (let ((method (tramp-file-name-method vec)) |
| 5167 | (user (tramp-file-name-user vec)) | 5167 | (user (tramp-file-name-user vec)) |
| 5168 | (host (tramp-file-name-real-host vec)) | 5168 | (host (tramp-file-name-real-host vec)) |
| 5169 | (localname (directory-file-name (tramp-file-name-localname vec)))) | 5169 | (localname (tramp-compat-file-name-unquote |
| 5170 | (directory-file-name (tramp-file-name-localname vec))))) | ||
| 5170 | (when (string-match tramp-ipv6-regexp host) | 5171 | (when (string-match tramp-ipv6-regexp host) |
| 5171 | (setq host (format "[%s]" host))) | 5172 | (setq host (format "[%s]" host))) |
| 5172 | (unless (string-match "ftp$" method) | 5173 | (unless (string-match "ftp$" method) |
| @@ -5175,9 +5176,8 @@ Return ATTR." | |||
| 5175 | ((tramp-get-method-parameter vec 'tramp-remote-copy-program) | 5176 | ((tramp-get-method-parameter vec 'tramp-remote-copy-program) |
| 5176 | localname) | 5177 | localname) |
| 5177 | ((not (zerop (length user))) | 5178 | ((not (zerop (length user))) |
| 5178 | (tramp-unquote-shell-quote-argument | 5179 | (tramp-shell-quote-argument (format "%s@%s:%s" user host localname))) |
| 5179 | (format "%s@%s:%s" user host localname))) | 5180 | (t (tramp-shell-quote-argument (format "%s:%s" host localname)))))) |
| 5180 | (t (tramp-unquote-shell-quote-argument (format "%s:%s" host localname)))))) | ||
| 5181 | 5181 | ||
| 5182 | (defun tramp-method-out-of-band-p (vec size) | 5182 | (defun tramp-method-out-of-band-p (vec size) |
| 5183 | "Return t if this is an out-of-band method, nil otherwise." | 5183 | "Return t if this is an out-of-band method, nil otherwise." |
diff --git a/lisp/net/tramp-smb.el b/lisp/net/tramp-smb.el index d6d4669c912..7d0dc664f8d 100644 --- a/lisp/net/tramp-smb.el +++ b/lisp/net/tramp-smb.el | |||
| @@ -604,7 +604,8 @@ PRESERVE-UID-GID and PRESERVE-EXTENDED-ATTRIBUTES are completely ignored." | |||
| 604 | v 'file-error "Target `%s' must contain a share name" newname)) | 604 | v 'file-error "Target `%s' must contain a share name" newname)) |
| 605 | (unless (tramp-smb-send-command | 605 | (unless (tramp-smb-send-command |
| 606 | v (format "put \"%s\" \"%s\"" | 606 | v (format "put \"%s\" \"%s\"" |
| 607 | filename (tramp-smb-get-localname v))) | 607 | (tramp-compat-file-name-unquote filename) |
| 608 | (tramp-smb-get-localname v))) | ||
| 608 | (tramp-error | 609 | (tramp-error |
| 609 | v 'file-error "Cannot copy `%s' to `%s'" filename newname)))))) | 610 | v 'file-error "Cannot copy `%s' to `%s'" filename newname)))))) |
| 610 | 611 | ||
| @@ -1463,15 +1464,18 @@ target of the symlink differ." | |||
| 1463 | "Like `handle-substitute-in-file-name' for Tramp files. | 1464 | "Like `handle-substitute-in-file-name' for Tramp files. |
| 1464 | \"//\" substitutes only in the local filename part. Catches | 1465 | \"//\" substitutes only in the local filename part. Catches |
| 1465 | errors for shares like \"C$/\", which are common in Microsoft Windows." | 1466 | errors for shares like \"C$/\", which are common in Microsoft Windows." |
| 1466 | (with-parsed-tramp-file-name filename nil | 1467 | ;; Check, whether the local part is a quoted file name. |
| 1467 | ;; Ignore in LOCALNAME everything before "//". | 1468 | (if (tramp-compat-file-name-quoted-p filename) |
| 1468 | (when (and (stringp localname) (string-match ".+?/\\(/\\|~\\)" localname)) | 1469 | filename |
| 1469 | (setq filename | 1470 | (with-parsed-tramp-file-name filename nil |
| 1470 | (concat (file-remote-p filename) | 1471 | ;; Ignore in LOCALNAME everything before "//". |
| 1471 | (replace-match "\\1" nil nil localname))))) | 1472 | (when (and (stringp localname) (string-match ".+?/\\(/\\|~\\)" localname)) |
| 1472 | (condition-case nil | 1473 | (setq filename |
| 1473 | (tramp-run-real-handler 'substitute-in-file-name (list filename)) | 1474 | (concat (file-remote-p filename) |
| 1474 | (error filename))) | 1475 | (replace-match "\\1" nil nil localname))))) |
| 1476 | (condition-case nil | ||
| 1477 | (tramp-run-real-handler 'substitute-in-file-name (list filename)) | ||
| 1478 | (error filename)))) | ||
| 1475 | 1479 | ||
| 1476 | (defun tramp-smb-handle-write-region | 1480 | (defun tramp-smb-handle-write-region |
| 1477 | (start end filename &optional append visit lockname confirm) | 1481 | (start end filename &optional append visit lockname confirm) |
| @@ -1521,7 +1525,8 @@ errors for shares like \"C$/\", which are common in Microsoft Windows." | |||
| 1521 | (defun tramp-smb-get-share (vec) | 1525 | (defun tramp-smb-get-share (vec) |
| 1522 | "Returns the share name of LOCALNAME." | 1526 | "Returns the share name of LOCALNAME." |
| 1523 | (save-match-data | 1527 | (save-match-data |
| 1524 | (let ((localname (tramp-file-name-localname vec))) | 1528 | (let ((localname |
| 1529 | (tramp-compat-file-name-unquote (tramp-file-name-localname vec)))) | ||
| 1525 | (when (string-match "^/?\\([^/]+\\)/" localname) | 1530 | (when (string-match "^/?\\([^/]+\\)/" localname) |
| 1526 | (match-string 1 localname))))) | 1531 | (match-string 1 localname))))) |
| 1527 | 1532 | ||
| @@ -1529,7 +1534,8 @@ errors for shares like \"C$/\", which are common in Microsoft Windows." | |||
| 1529 | "Returns the file name of LOCALNAME. | 1534 | "Returns the file name of LOCALNAME. |
| 1530 | If VEC has no cifs capabilities, exchange \"/\" by \"\\\\\"." | 1535 | If VEC has no cifs capabilities, exchange \"/\" by \"\\\\\"." |
| 1531 | (save-match-data | 1536 | (save-match-data |
| 1532 | (let ((localname (tramp-file-name-localname vec))) | 1537 | (let ((localname |
| 1538 | (tramp-compat-file-name-unquote (tramp-file-name-localname vec)))) | ||
| 1533 | (setq | 1539 | (setq |
| 1534 | localname | 1540 | localname |
| 1535 | (if (string-match "^/?[^/]+\\(/.*\\)" localname) | 1541 | (if (string-match "^/?[^/]+\\(/.*\\)" localname) |
diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index 48ae6e06000..100be3ac541 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el | |||
| @@ -1679,27 +1679,6 @@ FILE must be a local file name on a connection identified via VEC." | |||
| 1679 | (font-lock-add-keywords | 1679 | (font-lock-add-keywords |
| 1680 | 'emacs-lisp-mode '("\\<with-tramp-connection-property\\>")) | 1680 | 'emacs-lisp-mode '("\\<with-tramp-connection-property\\>")) |
| 1681 | 1681 | ||
| 1682 | (defsubst tramp-quoted-name-p (name) | ||
| 1683 | "Whether NAME is quoted with prefix \"/:\". | ||
| 1684 | If NAME is a remote file name, check the local part of NAME." | ||
| 1685 | (string-match "^/:" (or (file-remote-p name 'localname) name))) | ||
| 1686 | |||
| 1687 | (defsubst tramp-quote-name (name) | ||
| 1688 | "Add the quotation prefix \"/:\" to file NAME. | ||
| 1689 | If NAME is a remote file name, the local part of NAME is quoted." | ||
| 1690 | (concat (file-remote-p name) "/:" (or (file-remote-p name 'localname) name))) | ||
| 1691 | |||
| 1692 | (defsubst tramp-unquote-name (name) | ||
| 1693 | "Remove quotation prefix \"/:\" from file NAME. | ||
| 1694 | If NAME is a remote file name, the local part of NAME is unquoted." | ||
| 1695 | (save-match-data | ||
| 1696 | (let ((localname (or (file-remote-p name 'localname) name))) | ||
| 1697 | (when (tramp-quoted-name-p localname) | ||
| 1698 | (setq | ||
| 1699 | localname | ||
| 1700 | (replace-match (if (= (length localname) 2) "/" "") nil t localname))) | ||
| 1701 | (concat (file-remote-p name) localname)))) | ||
| 1702 | |||
| 1703 | (defun tramp-drop-volume-letter (name) | 1682 | (defun tramp-drop-volume-letter (name) |
| 1704 | "Cut off unnecessary drive letter from file NAME. | 1683 | "Cut off unnecessary drive letter from file NAME. |
| 1705 | The functions `tramp-*-handle-expand-file-name' call `expand-file-name' | 1684 | The functions `tramp-*-handle-expand-file-name' call `expand-file-name' |
| @@ -3345,7 +3324,7 @@ User is always nil." | |||
| 3345 | "Like `substitute-in-file-name' for Tramp files. | 3324 | "Like `substitute-in-file-name' for Tramp files. |
| 3346 | \"//\" and \"/~\" substitute only in the local filename part." | 3325 | \"//\" and \"/~\" substitute only in the local filename part." |
| 3347 | ;; Check, whether the local part is a quoted file name. | 3326 | ;; Check, whether the local part is a quoted file name. |
| 3348 | (if (tramp-quoted-name-p filename) | 3327 | (if (tramp-compat-file-name-quoted-p filename) |
| 3349 | filename | 3328 | filename |
| 3350 | ;; First, we must replace environment variables. | 3329 | ;; First, we must replace environment variables. |
| 3351 | (setq filename (tramp-replace-environment-variables filename)) | 3330 | (setq filename (tramp-replace-environment-variables filename)) |
| @@ -4105,7 +4084,7 @@ this file, if that variable is non-nil." | |||
| 4105 | ("|" . "__") | 4084 | ("|" . "__") |
| 4106 | ("[" . "_l") | 4085 | ("[" . "_l") |
| 4107 | ("]" . "_r")) | 4086 | ("]" . "_r")) |
| 4108 | (tramp-unquote-name (buffer-file-name))) | 4087 | (tramp-compat-file-name-unquote (buffer-file-name))) |
| 4109 | tramp-auto-save-directory)))) | 4088 | tramp-auto-save-directory)))) |
| 4110 | ;; Run plain `make-auto-save-file-name'. | 4089 | ;; Run plain `make-auto-save-file-name'. |
| 4111 | (tramp-run-real-handler 'make-auto-save-file-name nil))) | 4090 | (tramp-run-real-handler 'make-auto-save-file-name nil))) |
| @@ -4307,7 +4286,7 @@ T1 and T2 are time values (as returned by `current-time' for example)." | |||
| 4307 | 4286 | ||
| 4308 | (defun tramp-unquote-shell-quote-argument (s) | 4287 | (defun tramp-unquote-shell-quote-argument (s) |
| 4309 | "Remove quotation prefix \"/:\" from string S, and quote it then for shell." | 4288 | "Remove quotation prefix \"/:\" from string S, and quote it then for shell." |
| 4310 | (shell-quote-argument (tramp-unquote-name s))) | 4289 | (shell-quote-argument (tramp-compat-file-name-unquote s))) |
| 4311 | 4290 | ||
| 4312 | ;; Currently (as of Emacs 20.5), the function `shell-quote-argument' | 4291 | ;; Currently (as of Emacs 20.5), the function `shell-quote-argument' |
| 4313 | ;; does not deal well with newline characters. Newline is replaced by | 4292 | ;; does not deal well with newline characters. Newline is replaced by |
diff --git a/test/lisp/net/tramp-tests.el b/test/lisp/net/tramp-tests.el index c2984dfc776..2d17fa08ca5 100644 --- a/test/lisp/net/tramp-tests.el +++ b/test/lisp/net/tramp-tests.el | |||
| @@ -116,7 +116,7 @@ being the result.") | |||
| 116 | If LOCAL is non-nil, a local file is created. | 116 | If LOCAL is non-nil, a local file is created. |
| 117 | If QUOTED is non-nil, the local part of the file is quoted." | 117 | If QUOTED is non-nil, the local part of the file is quoted." |
| 118 | (funcall | 118 | (funcall |
| 119 | (if quoted 'tramp-quote-name 'identity) | 119 | (if quoted 'tramp-compat-file-name-quote 'identity) |
| 120 | (expand-file-name | 120 | (expand-file-name |
| 121 | (make-temp-name "tramp-test") | 121 | (make-temp-name "tramp-test") |
| 122 | (if local temporary-file-directory tramp-test-temporary-file-directory)))) | 122 | (if local temporary-file-directory tramp-test-temporary-file-directory)))) |
| @@ -1252,7 +1252,7 @@ This tests also `file-readable-p', `file-regular-p' and | |||
| 1252 | (should | 1252 | (should |
| 1253 | (string-equal | 1253 | (string-equal |
| 1254 | (funcall | 1254 | (funcall |
| 1255 | (if quoted 'tramp-quote-name 'identity) | 1255 | (if quoted 'tramp-compat-file-name-quote 'identity) |
| 1256 | (car attr)) | 1256 | (car attr)) |
| 1257 | (file-remote-p (file-truename tmp-name1) 'localname))) | 1257 | (file-remote-p (file-truename tmp-name1) 'localname))) |
| 1258 | (delete-file tmp-name2)) | 1258 | (delete-file tmp-name2)) |
| @@ -2010,7 +2010,7 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'." | |||
| 2010 | (string-equal | 2010 | (string-equal |
| 2011 | (make-auto-save-file-name) | 2011 | (make-auto-save-file-name) |
| 2012 | (funcall | 2012 | (funcall |
| 2013 | (if quoted 'tramp-quote-name 'identity) | 2013 | (if quoted 'tramp-compat-file-name-quote 'identity) |
| 2014 | (expand-file-name | 2014 | (expand-file-name |
| 2015 | (format "#%s#" (file-name-nondirectory tmp-name1)) | 2015 | (format "#%s#" (file-name-nondirectory tmp-name1)) |
| 2016 | tramp-test-temporary-file-directory)))))) | 2016 | tramp-test-temporary-file-directory)))))) |
| @@ -2033,7 +2033,7 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'." | |||
| 2033 | ("|" . "__") | 2033 | ("|" . "__") |
| 2034 | ("[" . "_l") | 2034 | ("[" . "_l") |
| 2035 | ("]" . "_r")) | 2035 | ("]" . "_r")) |
| 2036 | (tramp-unquote-name tmp-name1))) | 2036 | (tramp-compat-file-name-unquote tmp-name1))) |
| 2037 | tmp-name2))) | 2037 | tmp-name2))) |
| 2038 | (should (file-directory-p tmp-name2)))) | 2038 | (should (file-directory-p tmp-name2)))) |
| 2039 | 2039 | ||
| @@ -2056,7 +2056,7 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'." | |||
| 2056 | ("|" . "__") | 2056 | ("|" . "__") |
| 2057 | ("[" . "_l") | 2057 | ("[" . "_l") |
| 2058 | ("]" . "_r")) | 2058 | ("]" . "_r")) |
| 2059 | (tramp-unquote-name tmp-name1))) | 2059 | (tramp-compat-file-name-unquote tmp-name1))) |
| 2060 | tmp-name2))) | 2060 | tmp-name2))) |
| 2061 | (should (file-directory-p tmp-name2))))) | 2061 | (should (file-directory-p tmp-name2))))) |
| 2062 | 2062 | ||
| @@ -2188,7 +2188,7 @@ Several special characters do not work properly there." | |||
| 2188 | (should | 2188 | (should |
| 2189 | (string-equal | 2189 | (string-equal |
| 2190 | (funcall | 2190 | (funcall |
| 2191 | (if quoted 'tramp-quote-name 'identity) | 2191 | (if quoted 'tramp-compat-file-name-quote 'identity) |
| 2192 | (car (file-attributes file3))) | 2192 | (car (file-attributes file3))) |
| 2193 | (file-remote-p (file-truename file1) 'localname))) | 2193 | (file-remote-p (file-truename file1) 'localname))) |
| 2194 | ;; Check file contents. | 2194 | ;; Check file contents. |
| @@ -2264,7 +2264,7 @@ Several special characters do not work properly there." | |||
| 2264 | (should | 2264 | (should |
| 2265 | (string-equal | 2265 | (string-equal |
| 2266 | (funcall | 2266 | (funcall |
| 2267 | (if quoted 'tramp-quote-name 'identity) | 2267 | (if quoted 'tramp-compat-file-name-quote 'identity) |
| 2268 | (cadr (car (directory-files-and-attributes | 2268 | (cadr (car (directory-files-and-attributes |
| 2269 | file1 nil (regexp-quote elt1))))) | 2269 | file1 nil (regexp-quote elt1))))) |
| 2270 | (file-remote-p (file-truename file2) 'localname))) | 2270 | (file-remote-p (file-truename file2) 'localname))) |