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:
authorCampbell Barton <ideasman42@gmail.com>2007-03-10 14:47:24 +0300
committerCampbell Barton <ideasman42@gmail.com>2007-03-10 14:47:24 +0300
commita8695b1c6e61acaf5fde5b7c5188d361a3ba4ebb (patch)
tree9d4454caa13c7016a6392d0d98006f6fa7ff25bb /source/blender/python/api2_2x/Sys.c
parent59ff076d033009f210a517cca55c4cbd5a97dec3 (diff)
removed python oops access, (was unreliable and nobody used it)
oops data access need to be done differently. Blender.sys fix for win32 path bug 6193
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;