1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-15 10:30:25 -08:00

Fix problem in tramp-smb.el

* lisp/net/tramp-smb.el (tramp-smb-handle-file-attributes):
Use `directory-file-name'.

* test/lisp/net/tramp-tests.el (tramp-test18-file-attributes)
(tramp-test19-directory-files-and-attributes): Extend tests.
This commit is contained in:
Michael Albinus 2025-07-30 09:33:20 +02:00
parent edd1f0512f
commit 4516091fd8
2 changed files with 12 additions and 2 deletions

View file

@ -3902,7 +3902,11 @@ This tests also `access-file', `file-readable-p',
(when test-file-ownership-preserved-p
(should (file-ownership-preserved-p tmp-name1 'group)))
(setq attr (file-attributes tmp-name1))
(should (eq (file-attribute-type attr) t)))
(should (eq (file-attribute-type attr) t))
;; A trailing slash shouldn't harm.
(should
(equal (file-attributes tmp-name1)
(file-attributes (file-name-as-directory tmp-name1)))))
;; Cleanup.
(ignore-errors (delete-directory tmp-name1 'recursive))
@ -4138,7 +4142,12 @@ They might differ only in time attributes or directory size."
;; Check the COUNT arg.
(setq attr (directory-files-and-attributes
tmp-name2 nil (rx bos "b") nil nil 1))
(should (equal (mapcar #'car attr) '("bar"))))
(should (equal (mapcar #'car attr) '("bar")))
;; A trailing slash shouldn't harm.
(should
(equal (file-attributes tmp-name2)
(file-attributes (file-name-as-directory tmp-name2)))))
;; Cleanup.
(ignore-errors (delete-directory tmp-name1 'recursive))))))