--- a/hal.h Sun Jul 31 22:53:57 2005 +0000
+++ b/hal.h Mon Aug 01 00:14:22 2005 +0000
@@ -87,7 +87,7 @@
// Return path, free space and stringID
StringID FiosGetDescText(const char **path, uint32 *tot);
// Delete a name
-void FiosDelete(const char *name);
+bool FiosDelete(const char *name);
// Make a filename from a name
void FiosMakeSavegameName(char *buf, const char *name);
--- a/misc_gui.c Sun Jul 31 22:53:57 2005 +0000
+++ b/misc_gui.c Mon Aug 01 00:14:22 2005 +0000
@@ -1328,7 +1328,9 @@
break;
case WE_TIMEOUT:
if (HASBIT(w->click_state, 10)) { /* Delete button clicked */
- FiosDelete(WP(w,querystr_d).text.buf);
+ if (!FiosDelete(WP(w,querystr_d).text.buf)) {
+ ShowErrorMessage(INVALID_STRING_ID, STR_4008_UNABLE_TO_DELETE_FILE, 0, 0);
+ }
SetWindowDirty(w);
BuildFileList();
if (_saveload_mode == SLD_SAVE_GAME) {
--- a/os2.c Sun Jul 31 22:53:57 2005 +0000
+++ b/os2.c Mon Aug 01 00:14:22 2005 +0000
@@ -415,12 +415,12 @@
sprintf(buf, "%s\\%s%s", _fios_path, name, extension);
}
-void FiosDelete(const char *name)
+bool FiosDelete(const char *name)
{
char path[512];
snprintf(path, lengthof(path), "%s\\%s", _fios_path, name);
- unlink(path);
+ return unlink(path) == 0;
}
bool FileExists(const char *filename)
--- a/unix.c Sun Jul 31 22:53:57 2005 +0000
+++ b/unix.c Mon Aug 01 00:14:22 2005 +0000
@@ -353,12 +353,12 @@
sprintf(buf, "%s/%s%s", _fios_path, name, extension);
}
-void FiosDelete(const char *name)
+bool FiosDelete(const char *name)
{
char path[512];
snprintf(path, lengthof(path), "%s/%s", _fios_path, name);
- unlink(path);
+ return unlink(path) == 0;
}
bool FileExists(const char *filename)
--- a/win32.c Sun Jul 31 22:53:57 2005 +0000
+++ b/win32.c Mon Aug 01 00:14:22 2005 +0000
@@ -911,12 +911,12 @@
sprintf(buf, "%s\\%s%s", _fios_path, name, extension);
}
-void FiosDelete(const char *name)
+bool FiosDelete(const char *name)
{
char path[512];
snprintf(path, lengthof(path), "%s\\%s", _fios_path, name);
- DeleteFile(path);
+ return DeleteFile(path) != 0;
}
bool FileExists(const char *filename)