diff options
author | Jonas Suhr Christensen <jsc@umbraculum.org> | 2014-09-23 18:28:07 +0200 |
---|---|---|
committer | Jonas Suhr Christensen <jsc@umbraculum.org> | 2014-09-23 18:28:07 +0200 |
commit | 5a81864b7f9b2c205d779b74ddb2e25d0df75f3e (patch) | |
tree | f5a511f1d87f81a47e51d5cacee0fa212bbfe2c2 | |
parent | 8681d056216b49a9963cbaa177dd3c4b7f76cb69 (diff) |
Testing file attribute filter on windows XP.
-rw-r--r-- | plugingui/directory.cc | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/plugingui/directory.cc b/plugingui/directory.cc index 48e67c6..ff0fa05 100644 --- a/plugingui/directory.cc +++ b/plugingui/directory.cc @@ -319,8 +319,14 @@ bool Directory::exists(std::string path) bool Directory::isHidden(std::string path) { DEBUG(directory, "Is '%s' hidden?\n", path.c_str()); - // TODO: Handle hidden and system files in windows #ifdef WIN32 + // We dont want to filter out '..' pointing to root of a partition + unsigned pos = path.find_last_of("/\\"); + std::string entry = path.substr(pos+1); + if(entry == "..") { + return false; + } + DWORD fattribs = GetFileAttributes(path.c_str()); if(fattribs & FILE_ATTRIBUTE_HIDDEN) { DEBUG(directory, "\t...yes!\n"); |