[Scummvm-cvs-logs] scummvm master -> efb1d96d98e7bc856522772bbcdb266e11e26a29
digitall
digitall at scummvm.org
Wed Jul 4 03:18:59 CEST 2012
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
efb1d96d98 TEENAGENT: Fix erroneous files in savegame listing.
Commit: efb1d96d98e7bc856522772bbcdb266e11e26a29
https://github.com/scummvm/scummvm/commit/efb1d96d98e7bc856522772bbcdb266e11e26a29
Author: D G Turner (digitall at scummvm.org)
Date: 2012-07-03T18:13:40-07:00
Commit Message:
TEENAGENT: Fix erroneous files in savegame listing.
This was achieved by making the detection pattern stricter to avoid
matching the dat file or other extraneous files in the savegame path.
This fixes bug #3539774 "TEENAGENT : teenagent.dat considered as a
savegame".
Also did some minor formatting and string function usage cleanup.
Changed paths:
engines/teenagent/detection.cpp
diff --git a/engines/teenagent/detection.cpp b/engines/teenagent/detection.cpp
index f516ee0..2de6f49 100644
--- a/engines/teenagent/detection.cpp
+++ b/engines/teenagent/detection.cpp
@@ -80,7 +80,7 @@ static const ADGameDescription teenAgentGameDescriptions[] = {
};
enum {
- MAX_SAVES = 20
+ MAX_SAVES = 20
};
class TeenAgentMetaEngine : public AdvancedMetaEngine {
@@ -123,16 +123,15 @@ public:
virtual SaveStateList listSaves(const char *target) const {
Common::String pattern = target;
- pattern += ".*";
+ pattern += ".??";
Common::StringArray filenames = g_system->getSavefileManager()->listSavefiles(pattern);
Common::sort(filenames.begin(), filenames.end());
SaveStateList saveList;
for (Common::StringArray::const_iterator file = filenames.begin(); file != filenames.end(); ++file) {
- int slot;
- const char *ext = strrchr(file->c_str(), '.');
- if (ext && (slot = atoi(ext + 1)) >= 0 && slot < MAX_SAVES) {
+ int slot = atoi(file->c_str() + file->size() - 2);
+ if (slot >= 0 && slot < MAX_SAVES) {
Common::ScopedPtr<Common::InSaveFile> in(g_system->getSavefileManager()->openForLoading(*file));
if (!in)
continue;
More information about the Scummvm-git-logs
mailing list