diff options
Diffstat (limited to 'source/blender/blenlib/intern/winstuff.c')
-rw-r--r-- | source/blender/blenlib/intern/winstuff.c | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/source/blender/blenlib/intern/winstuff.c b/source/blender/blenlib/intern/winstuff.c index 90754e7d2bb..596ab2b0470 100644 --- a/source/blender/blenlib/intern/winstuff.c +++ b/source/blender/blenlib/intern/winstuff.c @@ -307,21 +307,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 */ |