diff options
author | Martin Kiewitz | 2010-08-30 10:14:50 +0000 |
---|---|---|
committer | Martin Kiewitz | 2010-08-30 10:14:50 +0000 |
commit | 154099d0a4fac94a5e9ae811a4e14d1d8e3e0244 (patch) | |
tree | ee74f332b55287d358b084342c0bf456bf65bebf /engines | |
parent | 6d7d0ee94086d532b6263ff86705d8952aa20c49 (diff) | |
download | scummvm-rg350-154099d0a4fac94a5e9ae811a4e14d1d8e3e0244.tar.gz scummvm-rg350-154099d0a4fac94a5e9ae811a4e14d1d8e3e0244.tar.bz2 scummvm-rg350-154099d0a4fac94a5e9ae811a4e14d1d8e3e0244.zip |
SCI: check filesize of qfg import files
filter out files that are larger than 1k, actually removes real saved games from the list
svn-id: r52450
Diffstat (limited to 'engines')
-rw-r--r-- | engines/sci/engine/kfile.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/engines/sci/engine/kfile.cpp b/engines/sci/engine/kfile.cpp index 48f3691cb5..a70ada5458 100644 --- a/engines/sci/engine/kfile.cpp +++ b/engines/sci/engine/kfile.cpp @@ -914,9 +914,17 @@ void DirSeeker::addAsVirtualFiles(Common::String title, Common::String fileMask) _virtualFiles.push_back(""); Common::StringArray::iterator it; Common::StringArray::iterator it_end = foundFiles.end(); + Common::SaveFileManager *saveFileMan = g_engine->getSaveFileManager(); + for (it = foundFiles.begin(); it != it_end; it++) { Common::String regularFilename = *it; Common::String wrappedFilename = Common::String(regularFilename.c_str() + fileMask.size() - 1); + + Common::SeekableReadStream *testfile = saveFileMan->openForLoading(regularFilename); + int32 testfileSize = testfile->size(); + delete testfile; + if (testfileSize > 1024) + continue; // We need to remove the prefix for display purposes _files.push_back(wrappedFilename); // but remember the actual name as well |