ecore_file: Fix ecore_file_file_get function on Windows.
authorJaehyun Cho <jae_hyun.cho@samsung.com>
Mon, 2 Nov 2015 01:19:39 +0000 (10:19 +0900)
committerJaehyun Cho <jae_hyun.cho@samsung.com>
Mon, 2 Nov 2015 01:32:10 +0000 (10:32 +0900)
On Windows, both backslash and slash can be used as file path
separators. Therefore, it is fixed to consider backslash as a file path
separator as well on Windows.

@fix

src/lib/ecore_file/ecore_file.c

index 3bb8b1e..07d247b 100644 (file)
@@ -775,6 +775,16 @@ ecore_file_file_get(const char *path)
    if (!path) return NULL;
    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;
+     }
+#endif
+
    return result;
 }