Commit bbed124
committed
Make lfs.dir error out when the directory can't be opened
Both platform implementations of DirectoryIterator swallow open
failures and produce an empty iteration, but require 'lfs' in
automation scripts transparently resolves to aegisub.lfs, and vanilla
lfs.dir raises "cannot open <path>: <reason>" immediately. Scripts
using pcall lfs.dir to detect missing or unreadable directories took
the wrong branch under Aegisub.
Validate the path in dir_new rather than changing DirectoryIterator,
since the rest of the app plausibly relies on silently scanning
possibly-missing directories. This also makes the error path in
lfs.moon's dir reachable, which until now was dead code on every
platform.1 parent 38e57a3 commit bbed124
2 files changed
Lines changed: 21 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
85 | 85 | | |
86 | 86 | | |
87 | 87 | | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| 21 | + | |
| 22 | + | |
21 | 23 | | |
22 | 24 | | |
23 | 25 | | |
| |||
94 | 96 | | |
95 | 97 | | |
96 | 98 | | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
97 | 105 | | |
98 | 106 | | |
99 | 107 | | |
| |||
0 commit comments