From d97f4337147b69b9f9a6e72686f642b7d3e0b279 Mon Sep 17 00:00:00 2001 From: Vincent Torri Date: Thu, 15 Oct 2015 14:36:17 +0200 Subject: [PATCH] Ecore_File: fix ecore_file_file_get() on Windows @fix --- src/lib/ecore_file/ecore_file.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/lib/ecore_file/ecore_file.c b/src/lib/ecore_file/ecore_file.c index 07d247bea0..52d203e1c0 100644 --- a/src/lib/ecore_file/ecore_file.c +++ b/src/lib/ecore_file/ecore_file.c @@ -29,7 +29,6 @@ /* * FIXME: the following functions will certainly not work on Windows: - * ecore_file_file_get() * ecore_file_app_exe_get() * ecore_file_escape_name() */ @@ -773,6 +772,23 @@ ecore_file_file_get(const char *path) char *result = NULL; if (!path) return NULL; + +#ifdef _WIN32 + { + char buf[MAX_PATH]; + + memcpy(buf, path, strlen(path) + 1); + EVIL_PATH_SEP_UNIX_TO_WIN32(buf); + if ((result = strrchr(buf, '\\'))) + { + result++; + return path + (result - buf); + } + else + return path; + } +#endif + if ((result = strrchr(path, '/'))) result++; else result = (char *)path;