[Scummvm-cvs-logs] SF.net SVN: scummvm:[50895] scummvm/trunk/engines/sci/engine/kfile.cpp

m_kiewitz at users.sourceforge.net m_kiewitz at users.sourceforge.net
Wed Jul 14 23:17:58 CEST 2010


Revision: 50895
          http://scummvm.svn.sourceforge.net/scummvm/?rev=50895&view=rev
Author:   m_kiewitz
Date:     2010-07-14 21:17:56 +0000 (Wed, 14 Jul 2010)

Log Message:
-----------
SCI: returning DOS error code on kFileIO(unlink)

Modified Paths:
--------------
    scummvm/trunk/engines/sci/engine/kfile.cpp

Modified: scummvm/trunk/engines/sci/engine/kfile.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/kfile.cpp	2010-07-14 21:00:59 UTC (rev 50894)
+++ scummvm/trunk/engines/sci/engine/kfile.cpp	2010-07-14 21:17:56 UTC (rev 50895)
@@ -782,6 +782,8 @@
 	case K_FILEIO_UNLINK : {
 		Common::String name = s->_segMan->getString(argv[1]);
 		Common::SaveFileManager *saveFileMan = g_engine->getSaveFileManager();
+		bool result;
+
 		// SQ4 floppy prepends /\ to the filenames
 		if (name.hasPrefix("/\\")) {
 			name.deleteChar(0);
@@ -800,17 +802,16 @@
 			listSavegames(saves);
 			int savedir_nr = saves[slotNum].id;
 			name = g_sci->getSavegameName(savedir_nr);
-			saveFileMan->removeSavefile(name);
+			result = saveFileMan->removeSavefile(name);
 		} else {
 			const Common::String wrappedName = g_sci->wrapFilename(name);
-			saveFileMan->removeSavefile(wrappedName);
+			result = saveFileMan->removeSavefile(wrappedName);
 		}
 
 		debugC(2, kDebugLevelFile, "kFileIO(unlink): %s", name.c_str());
-
-		// TODO/FIXME: Should we return something (like, a bool indicating
-		// whether deleting the save succeeded or failed)?
-		break;
+		if (result)
+			return NULL_REG;
+		return make_reg(0, 2); // DOS - file not found error code
 	}
 	case K_FILEIO_READ_STRING : {
 		int size = argv[2].toUint16();


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list