branch: master
commit d3c802883f904519bf77c70721f6541957c07967
Author: Oleh Krehel <[email protected]>
Commit: Oleh Krehel <[email protected]>

    ivy.el (ivy--sorted-files): Add a safety work-around
    
    It can happen that (all-completions "" 'read-file-name-internal) may
    fail on systems with symlinks. I think it's related to the file
    functions trying to compute occupied space. In any case, a plain
    `directory-files' is roughly the equivalent and is less likely to fail.
---
 ivy.el | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/ivy.el b/ivy.el
index eb6fe5d..8e03cc1 100644
--- a/ivy.el
+++ b/ivy.el
@@ -1232,7 +1232,10 @@ like.")
   "Return the list of files in DIR.
 Directories come first."
   (let* ((default-directory dir)
-         (seq (all-completions "" 'read-file-name-internal))
+         (seq (condition-case nil
+                  (all-completions "" 'read-file-name-internal)
+                (error
+                 (directory-files dir))))
          sort-fn)
     (if (equal dir "/")
         seq

Reply via email to