mirror of
https://github.com/Abdess/retroarch_system.git
synced 2026-11-04 09:03:47 -06:00
fix: name the closed folder behind a link
This commit is contained in:
1 parent
38190f009b
commit
78de625294
2 files changed
+52
-1
No files matched your search
+11
-1
@@ -4305,7 +4305,17 @@ def closed_folder(path: Path) -> tuple[Path, str] | None:
|
||||
except OSError as exc:
|
||||
if exc.errno in (errno.ENOENT, errno.ENOTDIR):
|
||||
return None
|
||||
return folder.parent, exc.strerror or str(exc)
|
||||
why = exc.strerror or str(exc)
|
||||
if exc.errno == errno.ELOOP:
|
||||
# The link that loops, not the open folder holding it.
|
||||
return folder, why
|
||||
real = Path(os.path.realpath(folder))
|
||||
if real != folder:
|
||||
# ~/Emulation linked into a closed card: the closed folder
|
||||
# is under the link's target, and naming the link's
|
||||
# parent told the user they cannot open their own HOME.
|
||||
return closed_folder(real) or (real.parent, why)
|
||||
return folder.parent, why
|
||||
return probe, failure.strerror or str(failure)
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user