From 771621e0c90ce667dbe7420b66105129efb09269 Mon Sep 17 00:00:00 2001 From: YoshiRulz Date: Tue, 28 Jul 2020 20:25:40 +1000 Subject: [PATCH] Teach DLIR that dirs are not files on Unix even though everything is a file --- src/BizHawk.Common/IImportResolver.cs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/BizHawk.Common/IImportResolver.cs b/src/BizHawk.Common/IImportResolver.cs index 7a69230b96..22d3265a1b 100644 --- a/src/BizHawk.Common/IImportResolver.cs +++ b/src/BizHawk.Common/IImportResolver.cs @@ -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;