diff --git a/BizHawk.Util/7z/Formats.cs b/BizHawk.Util/7z/Formats.cs
index 9b71bc1744..bd978baf18 100644
--- a/BizHawk.Util/7z/Formats.cs
+++ b/BizHawk.Util/7z/Formats.cs
@@ -508,31 +508,33 @@ namespace SevenZip
{
InSignatureFormatsReversed.Add(pair.Value, pair.Key);
}
- }
+ }
- ///
- /// Gets InArchiveFormat for specified archive file name
- ///
- /// Archive file name
- /// Indicates whether to throw exceptions
- /// InArchiveFormat recognized by the file name extension
- ///
- public static InArchiveFormat FormatByFileName(string fileName, bool reportErrors)
- {
- if (String.IsNullOrEmpty(fileName) && reportErrors)
- {
- throw new ArgumentException("File name is null or empty string!");
- }
- string extension = Path.GetExtension(fileName).Substring(1);
- if (!InExtensionFormats.ContainsKey(extension) && reportErrors)
- {
- if (FileChecker.ThrowExceptions)
- throw new ArgumentException("Extension \"" + extension + "\" is not a supported archive file name extension.");
- else return InArchiveFormat.None;
+ ///
+ /// Gets InArchiveFormat for specified archive file name
+ ///
+ /// Archive file name
+ /// Indicates whether to throw exceptions
+ /// InArchiveFormat recognized by the file name extension
+ ///
+ public static InArchiveFormat FormatByFileName(string fileName, bool reportErrors)
+ {
+ if (String.IsNullOrEmpty(fileName) && reportErrors)
+ {
+ throw new ArgumentException("File name is null or empty string!");
+ }
+ string extension = Path.GetExtension(fileName);
+ if (extension.StartsWith("."))
+ extension = extension.Substring(1);
+ if (!InExtensionFormats.ContainsKey(extension) && reportErrors)
+ {
+ if (FileChecker.ThrowExceptions)
+ throw new ArgumentException("Extension \"" + extension + "\" is not a supported archive file name extension.");
+ else return InArchiveFormat.None;
- }
- return InExtensionFormats[extension];
- }
- }
+ }
+ return InExtensionFormats[extension];
+ }
+ }
#endif
}
\ No newline at end of file