Fix file browser for Windows: going to the parent directory introduces ../\. Correct parent is ..\ under Windows.

This commit is contained in:
2008-09-22 21:15:48 +00:00
parent 0cf7bf7357
commit d438b466b7

View File

@@ -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 {