Fix disk-free info in 'insert-directory'

* lisp/files.el (insert-directory): Call 'get-free-disk-space'
with the argument FILE, to make sure the reported info is for the
correct volume.  (Bug#50630)

Copyright-paperwork-exempt: yes
This commit is contained in:
John Cummings 2021-09-16 23:00:50 +00:00 committed by Eli Zaretskii
parent a462ccd536
commit b95157de2d

View file

@ -7615,7 +7615,7 @@ normally equivalent short `-D' option is just passed on to
;; Replace "total" with "total used in directory" to
;; avoid confusion.
(replace-match "total used in directory" nil nil nil 1)
(let ((available (get-free-disk-space ".")))
(let ((available (get-free-disk-space file)))
(when available
(end-of-line)
(insert " available " available))))))))))