diff options
author | Martin Kiewitz | 2010-07-14 21:17:56 +0000 |
---|---|---|
committer | Martin Kiewitz | 2010-07-14 21:17:56 +0000 |
commit | 5e2758394cbc767ea1a3f30c7812c5f588346e1d (patch) | |
tree | df826eaf536185fc185d914a4c45d2c3f1a8d306 /engines/sci/engine | |
parent | 40ed004b18731c873524b4f3d7d6d6551ca00769 (diff) | |
download | scummvm-rg350-5e2758394cbc767ea1a3f30c7812c5f588346e1d.tar.gz scummvm-rg350-5e2758394cbc767ea1a3f30c7812c5f588346e1d.tar.bz2 scummvm-rg350-5e2758394cbc767ea1a3f30c7812c5f588346e1d.zip |
SCI: returning DOS error code on kFileIO(unlink)
svn-id: r50895
Diffstat (limited to 'engines/sci/engine')
-rw-r--r-- | engines/sci/engine/kfile.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/engines/sci/engine/kfile.cpp b/engines/sci/engine/kfile.cpp index 3848d413f2..eab2ece301 100644 --- a/engines/sci/engine/kfile.cpp +++ b/engines/sci/engine/kfile.cpp @@ -782,6 +782,8 @@ reg_t kFileIO(EngineState *s, int argc, reg_t *argv) { 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 @@ reg_t kFileIO(EngineState *s, int argc, reg_t *argv) { 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(); |