summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVincent Torri <vincent dot torri at gmail dot com>2015-10-15 14:36:17 +0200
committerNicolas Aguirre <aguirre.nicolas@gmail.com>2015-11-10 08:32:49 +0100
commit65c82ea15cb53473b4de398ee61a6c3b7047fc20 (patch)
treed1f0c983c38aff822bdad18fc11a456ac7e7abe6
parent0c12f9d881a832b0074f7a6651bf830d35f41aa4 (diff)
downloadefl-65c82ea15cb53473b4de398ee61a6c3b7047fc20.tar.gz
Ecore_File: fix ecore_file_file_get() on Windows
@fix
-rw-r--r--src/lib/ecore_file/ecore_file.c18
1 files changed, 17 insertions, 1 deletions
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;