#130: improved class DirBrowser

It doesn’t return filenames ‘.’ and ‘..’ (for current and parent
directories) anymore, eliminating the need to check and ignore these
names on each usage of the class.
This commit is contained in:
Andrey Prygunkov
2015-12-21 20:54:21 +01:00
parent c170d6a180
commit 19ce3bf69b
9 changed files with 72 additions and 79 deletions

View File

@@ -187,7 +187,7 @@ void Scanner::CheckIncomingNzbs(const char* directory, const char* category, boo
BString<1024> fullfilename("%s%s", directory, filename);
bool isDirectory = Util::DirectoryExists(fullfilename);
// check subfolders
if (isDirectory && strcmp(filename, ".") && strcmp(filename, ".."))
if (isDirectory)
{
fullfilename[strlen(fullfilename) + 1] = '\0';
fullfilename.AppendFmt("%c", PATH_SEPARATOR);