Include symlink size (path length) in Get_Folder_Size()

All we have to do is check for the case of a symlink as well.
st.st_size contains the length of the path the symlink points to.

Change-Id: I9a7b06ba11b5866e04599b8904fd42acf241abe2
This commit is contained in:
James Christopher Adduono
2017-01-13 18:15:01 -05:00
committed by Dees Troy
parent d73903c8eb
commit 1efebdc0bd

View File

@@ -81,7 +81,7 @@ uint64_t TWExclude::Get_Folder_Size(const string& Path) {
}
if ((st.st_mode & S_IFDIR) && !check_skip_dirs(FullPath) && de->d_type != DT_SOCK) {
dusize += Get_Folder_Size(FullPath);
} else if (st.st_mode & S_IFREG) {
} else if (st.st_mode & S_IFREG || st.st_mode & S_IFLNK) {
dusize += (uint64_t)(st.st_size);
}
}