Ecore_File: fix ecore_file_file_get() on Windows

@fix
This commit is contained in:
Vincent Torri 2015-10-15 14:36:17 +02:00 committed by Nicolas Aguirre
parent 247c860aac
commit d97f433714
1 changed files with 17 additions and 1 deletions

View File

@ -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;