Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/python/api2_2x/Sys.c')
-rw-r--r--source/blender/python/api2_2x/Sys.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/source/blender/python/api2_2x/Sys.c b/source/blender/python/api2_2x/Sys.c
index 1f8c9fa732a..db74ce40b4a 100644
--- a/source/blender/python/api2_2x/Sys.c
+++ b/source/blender/python/api2_2x/Sys.c
@@ -175,8 +175,12 @@ static PyObject *M_sys_basename( PyObject * self, PyObject * args )
"expected string argument" );
len = strlen( name );
-
+
+#ifdef WIN32
+ p = MAX2(strrchr( name, '/' ), strrchr( name, '\\' ));
+#else
p = strrchr( name, DIRSEP );
+#endif
if( p ) {
n = name + len - p - 1; /* - 1 because we don't want the sep */
@@ -201,7 +205,11 @@ static PyObject *M_sys_dirname( PyObject * self, PyObject * args )
return EXPP_ReturnPyObjError( PyExc_TypeError,
"expected string argument" );
+#ifdef WIN32
+ p = MAX2(strrchr( name, '/' ), strrchr( name, '\\' ));
+#else
p = strrchr( name, DIRSEP );
+#endif
if( p ) {
n = p - name;