(if (tramp-compat-file-name-quoted-p name)
'tramp-compat-file-name-quote 'identity)
(let ((name (tramp-compat-file-name-unquote name)))
- ;; A volume letter could occur also in encoded backup file names.
- (if (string-match "\\(\\`[[:alpha:]]:/\\|/!drive_[[:alpha:]]\\)" name)
+ (if (string-match "\\`[a-zA-Z]:/" name)
(replace-match "/" nil t name)
name)))))
(defun tramp-handle-find-backup-file-name (filename)
"Like `find-backup-file-name' for Tramp files."
(with-parsed-tramp-file-name filename nil
- (mapcar
- 'tramp-drop-volume-letter
- (let ((backup-directory-alist
- (if tramp-backup-directory-alist
- (mapcar
- (lambda (x)
- (cons
- (car x)
- (if (and (stringp (cdr x))
- (file-name-absolute-p (cdr x))
- (not (tramp-tramp-file-p (cdr x))))
- (tramp-make-tramp-file-name
- method user domain host port (cdr x) hop)
- (cdr x))))
- tramp-backup-directory-alist)
- backup-directory-alist)))
- (tramp-run-real-handler 'find-backup-file-name (list filename))))))
+ (let ((backup-directory-alist
+ (if tramp-backup-directory-alist
+ (mapcar
+ (lambda (x)
+ (cons
+ (car x)
+ (if (and (stringp (cdr x))
+ (file-name-absolute-p (cdr x))
+ (not (tramp-tramp-file-p (cdr x))))
+ (tramp-make-tramp-file-name
+ method user domain host port (cdr x) hop)
+ (cdr x))))
+ tramp-backup-directory-alist)
+ backup-directory-alist)))
+ (tramp-run-real-handler 'find-backup-file-name (list filename)))))
(defun tramp-handle-insert-directory
(filename switches &optional wildcard full-directory-p)