diff options
| author | Francesco Abbate <francesco.bbt@gmail.com> | 2022-01-05 23:32:26 +0100 |
|---|---|---|
| committer | Francesco Abbate <francesco.bbt@gmail.com> | 2022-01-05 23:32:26 +0100 |
| commit | 1b57107352dc8c26999febb93e46cb5338a00255 (patch) | |
| tree | f10fa21557984f2714c393b955a25ca024a4cf25 | |
| parent | 9929ca9c2d83231872a2b5fb05f4c27f41d092c0 (diff) | |
| download | lite-xl-1b57107352dc8c26999febb93e46cb5338a00255.tar.gz lite-xl-1b57107352dc8c26999febb93e46cb5338a00255.zip | |
Fix problem with special file types
For special file types like the ones in /dev/ the info
entry's type is neither file neither dir.
We prevent these kind of files from being listed in the
project.
| -rw-r--r-- | data/core/init.lua | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/data/core/init.lua b/data/core/init.lua index b97ab2d6..aba10d8f 100644 --- a/data/core/init.lua +++ b/data/core/init.lua @@ -133,7 +133,9 @@ end -- in project scan or falsy if it shouldn't appear in the list. local function get_project_file_info(root, file) local info = system.get_file_info(root .. file) - if info then + -- info can be not nil but info.type may be nil if is neither a file neither + -- a directory, for example for /dev/* entries on linux. + if info and info.type then info.filename = strip_leading_path(file) return fileinfo_pass_filter(info) and info end |
