diff options
author | Benoit Bolsee <benoit.bolsee@online.be> | 2008-09-23 01:15:48 +0400 |
---|---|---|
committer | Benoit Bolsee <benoit.bolsee@online.be> | 2008-09-23 01:15:48 +0400 |
commit | d438b466b75d44f1f80dbd1e0bcc6ae27d083461 (patch) | |
tree | c5d992b48b134ad6d7fce1d7ab916d0df0b771c4 /source/blender/blenlib | |
parent | 0cf7bf73576c99897a7838beae7b093d118bb0bb (diff) |
Fix file browser for Windows: going to the parent directory introduces ../\. Correct parent is ..\ under Windows.
Diffstat (limited to 'source/blender/blenlib')
-rw-r--r-- | source/blender/blenlib/intern/util.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/source/blender/blenlib/intern/util.c b/source/blender/blenlib/intern/util.c index 1630842be05..d65fe8a476a 100644 --- a/source/blender/blenlib/intern/util.c +++ b/source/blender/blenlib/intern/util.c @@ -1060,13 +1060,18 @@ void BLI_makestringcode(const char *relfile, char *file) int BLI_parent_dir(char *path) { +#ifdef WIN32 + static char *parent_dir="..\\"; +#else + static char *parent_dir="../"; +#endif char tmp[FILE_MAXDIR+FILE_MAXFILE+4]; BLI_strncpy(tmp, path, sizeof(tmp)); BLI_add_slash(tmp); - strcat(tmp, "../"); + strcat(tmp, parent_dir); BLI_cleanup_dir(NULL, tmp); - if (!BLI_testextensie(tmp, "../")) { + if (!BLI_testextensie(tmp, parent_dir)) { BLI_strncpy(path, tmp, sizeof(tmp)); return 1; } else { |