mirror of
https://github.com/SquidDev-CC/CC-Tweaked
synced 2026-05-31 18:02:06 +00:00
Prevent copying folders inside themselves
- contains now performs a case-insensitive comparison. While this is a little dubious, it's required for systems like Windows, where foo and Foo are the same folder. - Impose a depth limit on copyRecursive. If there are any other cases where we may try to copy a folder into itself, this should prevent the computer entirely crashing.
This commit is contained in:
@@ -116,7 +116,7 @@ public class BasicEnvironment implements IComputerEnvironment
|
||||
while( baseFile != null && !wholeFile.exists() )
|
||||
{
|
||||
baseFile = baseFile.getParentFile();
|
||||
wholeFile = new File( baseFile, "resources/" + fallback + "/" + path );
|
||||
wholeFile = new File( baseFile, "src/" + fallback + "/resources/" + path );
|
||||
}
|
||||
|
||||
if( !wholeFile.exists() ) throw new IllegalStateException( "Cannot find ROM mount at " + file );
|
||||
|
||||
Reference in New Issue
Block a user