zynaddsubfx

ZynAddSubFX open source synthesizer
Log | Files | Refs | Submodules | LICENSE

commit e1ef1a7d25db6a1ad152d8bd960ce1bba342e611
parent 134e46f6330f86303b7e01d6f7cfb5451a545745
Author: fundamental <mark.d.mccurry@gmail.com>
Date:   Sat,  9 Dec 2017 09:25:45 -0500

Force '..' in directory listing

In theory this fixes missing '..' directories on windows.

Diffstat:
Msrc/Misc/MiddleWare.cpp | 7+++++++
1 file changed, 7 insertions(+), 0 deletions(-)

diff --git a/src/Misc/MiddleWare.cpp b/src/Misc/MiddleWare.cpp @@ -904,6 +904,7 @@ static std::vector<std::string> getFiles(const char *folder, bool finddir) struct dirent *fn; std::vector<string> files; + bool has_updir = false; while((fn = readdir(dir))) { #ifndef WIN32 @@ -929,8 +930,14 @@ static std::vector<std::string> getFiles(const char *folder, bool finddir) #endif if(finddir == is_dir && strcmp(".", fn->d_name)) files.push_back(fn->d_name); + + if(!strcmp("..", fn->d_name)) + has_updir = true; } + if(finddir == true && has_updir == false) + files.push_back(".."); + closedir(dir); std::sort(begin(files), end(files)); return files;