From 9e6ee680b66628356b5142447bd63dff6b57fce5 Mon Sep 17 00:00:00 2001 From: Autechre Date: Thu, 24 Dec 2020 16:40:15 +0100 Subject: [PATCH] Revert "Windows long paths fix" --- libretro-common/compat/fopen_utf8.c | 19 ++----------------- 1 file changed, 2 insertions(+), 17 deletions(-) diff --git a/libretro-common/compat/fopen_utf8.c b/libretro-common/compat/fopen_utf8.c index 42d4c08310..85abb59ef9 100644 --- a/libretro-common/compat/fopen_utf8.c +++ b/libretro-common/compat/fopen_utf8.c @@ -21,7 +21,6 @@ */ #include -#include #include #include #include @@ -37,13 +36,9 @@ void *fopen_utf8(const char * filename, const char * mode) { - const char * filename_local = NULL; - const char* windows_long_prefix = "\\\\?\\"; - char long_filename[PATH_MAX_LENGTH]; - #if defined(LEGACY_WIN32) FILE *ret = NULL; - filename_local = utf8_to_local_string_alloc(filename); + char * filename_local = utf8_to_local_string_alloc(filename); if (!filename_local) return NULL; @@ -52,17 +47,7 @@ void *fopen_utf8(const char * filename, const char * mode) free(filename_local); return ret; #else -#ifdef _WIN32 - /* - prefix to tell Windows to bypass the ~260 characters limit in many I/O APIs - https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file - */ - snprintf(long_filename, PATH_MAX_LENGTH, "%s%s", windows_long_prefix, filename); - filename_local = long_filename; -#else - filename_local = filename; -#endif - wchar_t * filename_w = utf8_to_utf16_string_alloc(filename_local); + wchar_t * filename_w = utf8_to_utf16_string_alloc(filename); wchar_t * mode_w = utf8_to_utf16_string_alloc(mode); FILE* ret = NULL;