Teach DLIR that dirs are not files on Unix

even though everything is a file
This commit is contained in:
YoshiRulz 2020-07-28 20:25:40 +10:00
parent b6f4344592
commit 771621e0c9
No known key found for this signature in database
GPG Key ID: C4DE31C245353FB7
1 changed files with 7 additions and 1 deletions

View File

@ -34,7 +34,13 @@ namespace BizHawk.Common
private static string UnixResolveFilePath(string orig) => orig[0] == '/'
? orig
: UnixSearchPaths.Select(dir => dir + orig).FirstOrDefault(File.Exists) ?? orig;
: UnixSearchPaths.Select(dir => dir + orig)
.FirstOrDefault(s =>
{
var fi = new FileInfo(s);
return fi.Exists && (fi.Attributes & FileAttributes.Directory) != FileAttributes.Directory;
})
?? orig;
private IntPtr _p;