From a4a819c983e3b63ca25ad7d97c64a20ce9ac451c Mon Sep 17 00:00:00 2001
From: Rubidium <rubidium@openttd.org>
Date: Sun, 15 Jan 2023 10:53:32 +0100
Subject: [PATCH] Fix #9865: removing files with the console always failed

---
 src/console_cmds.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/console_cmds.cpp b/src/console_cmds.cpp
index 88cfaa43e8..67d3cd03b0 100644
--- a/src/console_cmds.cpp
+++ b/src/console_cmds.cpp
@@ -458,8 +458,8 @@ DEF_CONSOLE_CMD(ConRemove)
 	_console_file_list.ValidateFileList();
 	const FiosItem *item = _console_file_list.FindItem(file);
 	if (item != nullptr) {
-		if (!FiosDelete(item->name)) {
-			IConsolePrint(CC_ERROR, "Failed to delete '{}'.", file);
+		if (unlink(item->name) != 0) {
+			IConsolePrint(CC_ERROR, "Failed to delete '{}'.", item->name);
 		}
 	} else {
 		IConsolePrint(CC_ERROR, "'{}' could not be found.", file);