aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorVincent Torri <vincent dot torri at gmail dot com>2015-12-07 14:08:19 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2015-12-07 14:08:19 +0900
commit68107e5eb8f7e36f5ce1b894f31e045debc6d407 (patch)
treeed2b515be19196c4e2c10ffef55addc1c5030ebc /src
parentefl: add binary mode to open() calls (diff)
downloadefl-68107e5eb8f7e36f5ce1b894f31e045debc6d407.tar.gz
Ecore_File: fix merge and simplify logic in ecore_file_file_get() on WindoWS
Summary: Ecore_File: fix merge and simplify logic in ecore_file_file_get() on WindowS Reviewers: cedric, jpeg Reviewed By: jpeg Subscribers: jpeg Differential Revision: https://phab.enlightenment.org/D3404
Diffstat (limited to 'src')
-rw-r--r--src/lib/ecore_file/ecore_file.c31
1 files changed, 9 insertions, 22 deletions
diff --git a/src/lib/ecore_file/ecore_file.c b/src/lib/ecore_file/ecore_file.c
index 52d203e1c0..7a44680ba9 100644
--- a/src/lib/ecore_file/ecore_file.c
+++ b/src/lib/ecore_file/ecore_file.c
@@ -773,32 +773,19 @@ ecore_file_file_get(const char *path)
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;
#ifdef _WIN32
- char *result_backslash = NULL;
- if ((result_backslash = strrchr(path, '\\')))
- {
- result_backslash++;
- if (result_backslash > result) result = result_backslash;
- }
+ /*
+ * Here, we know that there is no more / in the string beginning at
+ * 'result'. So just check that there is no more \ from it.
+ */
+ {
+ char *result_backslash;
+ if ((result_backslash = strrchr(result, '\\')))
+ result = ++result_backslash;
+ }
#endif
return result;