From 84d16802a3193db0dcead59ef4f678ddc628e84c Mon Sep 17 00:00:00 2001
From: Ty Lamontagne <amfobes@gmail.com>
Date: Wed, 25 Sep 2024 18:16:16 -0400
Subject: [PATCH] iop/hostfs: don't replace back slashes with forward slashes
 on Windows

---
 pcsx2/IopBios.cpp | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/pcsx2/IopBios.cpp b/pcsx2/IopBios.cpp
index c27d49ccc353f..67bcbdfa57c85 100644
--- a/pcsx2/IopBios.cpp
+++ b/pcsx2/IopBios.cpp
@@ -153,9 +153,13 @@ namespace R3000A
 	// the directory is considered non-existant
 	static __fi std::string clean_path(const std::string& path)
 	{
+#ifndef _WIN32
 		std::string ret = path;
 		std::replace(ret.begin(), ret.end(), '\\', '/');
 		return ret;
+#else // This function will cause problems with Windows WSL / device paths where forward slashes are required
+		return path;
+#endif
 	}
 
 	static int host_stat(const std::string& path, fio_stat_t* host_stats, fio_stat_flags& stat = ioman_stat)