summaryrefslogtreecommitdiffstatshomepage
path: root/src/osd/windows/winfile.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/osd/windows/winfile.cpp')
-rw-r--r--src/osd/windows/winfile.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/osd/windows/winfile.cpp b/src/osd/windows/winfile.cpp
index da4b0361591..b83f0e041d9 100644
--- a/src/osd/windows/winfile.cpp
+++ b/src/osd/windows/winfile.cpp
@@ -20,6 +20,7 @@
// MAMEOS headers
#include "strconv.h"
#include "winutil.h"
+#include "winutf8.h"
#include "winfile.h"
@@ -45,9 +46,12 @@ extern const char *winfile_ptty_identifier;
// osd_open
//============================================================
-file_error osd_open(const char *path, UINT32 openflags, osd_file **file, UINT64 *filesize)
+file_error osd_open(const char *orig_path, UINT32 openflags, osd_file **file, UINT64 *filesize)
{
file_error filerr = FILERR_NONE;
+ char *path = nullptr;
+
+ osd_subst_env(&path, orig_path);
// convert path to TCHAR
TCHAR *t_path = tstring_from_utf8(path);
@@ -153,6 +157,7 @@ error:
*file = NULL;
}
osd_free(t_path);
+ osd_free(path);
return filerr;
}