Bugfixes part 3 #209

Open
andrey wants to merge 36 commits from bugfixes3 into master
Showing only changes of commit 4d9cd20ac5 - Show all commits
+6 -5
View File
@@ -372,15 +372,16 @@ PIVector<PIFile::FileInfo> PIDir::entries(const PIRegularExpression & regexp) {
closedir(dir); closedir(dir);
} }
# else # else
dirent ** list; dirent ** list = nullptr;
int cnt = scandir(p.data(), int cnt = scandir(p.data(),
&list, &list,
0, 0,
# if defined(MAC_OS) || defined(ANDROID) || defined(BLACKBERRY) # if defined(MAC_OS) || defined(ANDROID) || defined(BLACKBERRY)
alphasort); alphasort);
# else # else
versionsort); versionsort);
# endif # endif
if (cnt < 0) return ret;
for (int i = 0; i < cnt; ++i) { for (int i = 0; i < cnt; ++i) {
ret << PIFile::fileInfo(dp + PIString(list[i]->d_name)); ret << PIFile::fileInfo(dp + PIString(list[i]->d_name));
free(list[i]); free(list[i]);