diff options
Diffstat (limited to 'source/blender/blenlib/intern/winstuff.c')
-rw-r--r-- | source/blender/blenlib/intern/winstuff.c | 34 |
1 files changed, 15 insertions, 19 deletions
diff --git a/source/blender/blenlib/intern/winstuff.c b/source/blender/blenlib/intern/winstuff.c index 194a164216a..f2261546f5c 100644 --- a/source/blender/blenlib/intern/winstuff.c +++ b/source/blender/blenlib/intern/winstuff.c @@ -28,10 +28,6 @@ * Windows-posix compatibility layer, windows-specific functions. */ -#ifdef HAVE_CONFIG_H -#include <config.h> -#endif - #ifdef WIN32 #include <stdlib.h> @@ -225,21 +221,21 @@ int check_file_chars(char *filename) #include <string.h> char* dirname(char *path) { - char *p; - if( path == NULL || *path == '\0' ) - return "."; - p = path + strlen(path) - 1; - while( *p == '/' ) { - if( p == path ) - return path; - *p-- = '\0'; - } - while( p >= path && *p != '/' ) - p--; - return - p < path ? "." : - p == path ? "/" : - (*p = '\0', path); + char *p; + if( path == NULL || *path == '\0' ) + return "."; + p = path + strlen(path) - 1; + while( *p == '/' ) { + if( p == path ) + return path; + *p-- = '\0'; + } + while( p >= path && *p != '/' ) + p--; + return + p < path ? "." : + p == path ? "/" : + (*p = '\0', path); } /* End of copied part */ |