Check "." and ".." to delete all files in a dir.

Bug: 13421999
Change-Id: I9d0f65cfc9a0f18c7affc152a5b54f9970048e9c
main
Keisuke Kuroyanagi 2014-03-12 15:31:49 +09:00
parent 5dc17c22ca
commit 4bc35daaa2
1 changed files with 3 additions and 0 deletions

View File

@ -68,6 +68,9 @@ namespace latinime {
if (dirent->d_type == DT_DIR) {
continue;
}
if (strcmp(dirent->d_name, ".") == 0 || strcmp(dirent->d_name, "..") == 0) {
continue;
}
const int filePathBufSize = getFilePathBufSize(dirPath, dirent->d_name);
char filePath[filePathBufSize];
getFilePath(dirPath, dirent->d_name, filePathBufSize, filePath);