am 4bc35daa: Check "." and ".." to delete all files in a dir.

* commit '4bc35daaa2ebfb099b2f912ca67e77bd8e98fbb7':
  Check "." and ".." to delete all files in a dir.
main
Keisuke Kuroyanagi 2014-03-11 23:42:32 -07:00 committed by Android Git Automerger
commit b42a47f7a6
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);