partially fixes a possible hash-collision bug in FileSystem
This commit is contained in:
@@ -80,11 +80,14 @@ namespace OpenRa.FileFormats
|
||||
}
|
||||
|
||||
public static Stream Open(string filename)
|
||||
{
|
||||
if( filename.IndexOfAny( new char[] { '/', '\\' } ) == -1 )
|
||||
{
|
||||
var ret = GetFromCache( allFiles, filename )
|
||||
?? GetFromCache( allTemporaryFiles, filename );
|
||||
if( ret != null )
|
||||
return ret;
|
||||
}
|
||||
|
||||
foreach( IFolder folder in mountedFolders )
|
||||
{
|
||||
@@ -97,6 +100,8 @@ namespace OpenRa.FileFormats
|
||||
}
|
||||
|
||||
public static Stream OpenWithExts( string filename, params string[] exts )
|
||||
{
|
||||
if( filename.IndexOfAny( new char[] { '/', '\\' } ) == -1 )
|
||||
{
|
||||
foreach( var ext in exts )
|
||||
{
|
||||
@@ -105,6 +110,7 @@ namespace OpenRa.FileFormats
|
||||
if( s != null )
|
||||
return s;
|
||||
}
|
||||
}
|
||||
|
||||
foreach( var ext in exts )
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user