From 1efebdc0bdbab9d9ac2148b7f9b2e0ceb9e9e2f7 Mon Sep 17 00:00:00 2001 From: James Christopher Adduono Date: Fri, 13 Jan 2017 18:15:01 -0500 Subject: 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 --- exclude.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'exclude.cpp') diff --git a/exclude.cpp b/exclude.cpp index f992ecf02..789c246e2 100644 --- a/exclude.cpp +++ b/exclude.cpp @@ -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); } } -- cgit v1.2.3