summaryrefslogtreecommitdiff
path: root/src/lib/ecore_file
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/lib/ecore_file
parent0497b9685c782c24fba84a1d5391edaa8d5ce10a (diff)
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/lib/ecore_file')
-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)
773 773
774 if (!path) return NULL; 774 if (!path) return NULL;
775 775
776#ifdef _WIN32
777 {
778 char buf[MAX_PATH];
779
780 memcpy(buf, path, strlen(path) + 1);
781 EVIL_PATH_SEP_UNIX_TO_WIN32(buf);
782 if ((result = strrchr(buf, '\\')))
783 {
784 result++;
785 return path + (result - buf);
786 }
787 else
788 return path;
789 }
790#endif
791
792 if ((result = strrchr(path, '/'))) result++; 776 if ((result = strrchr(path, '/'))) result++;
793 else result = (char *)path; 777 else result = (char *)path;
794 778
795#ifdef _WIN32 779#ifdef _WIN32
796 char *result_backslash = NULL; 780 /*
797 if ((result_backslash = strrchr(path, '\\'))) 781 * Here, we know that there is no more / in the string beginning at
798 { 782 * 'result'. So just check that there is no more \ from it.
799 result_backslash++; 783 */
800 if (result_backslash > result) result = result_backslash; 784 {
801 } 785 char *result_backslash;
786 if ((result_backslash = strrchr(result, '\\')))
787 result = ++result_backslash;
788 }
802#endif 789#endif
803 790
804 return result; 791 return result;