From: Eric Biggers Date: Sun, 28 Apr 2013 19:52:23 +0000 (-0500) Subject: win32-tree-cmp: Do not compare sizes on directories X-Git-Tag: v1.3.3~6 X-Git-Url: https://wimlib.net/git/?p=wimlib;a=commitdiff_plain;h=4479cdb48ceedcf5cf5175f15771cd118240a99e win32-tree-cmp: Do not compare sizes on directories --- diff --git a/tests/win32-tree-cmp.c b/tests/win32-tree-cmp.c index 3de18a0d..7b1530c2 100644 --- a/tests/win32-tree-cmp.c +++ b/tests/win32-tree-cmp.c @@ -515,13 +515,17 @@ tree_cmp(wchar_t *path_1, size_t path_1_len, wchar_t *path_2, size_t path_2_len) path_2, (unsigned)file_info_2.dwFileAttributes); } - size_1 = ((u64)file_info_1.nFileSizeHigh << 32) | - file_info_1.nFileSizeLow; - size_2 = ((u64)file_info_2.nFileSizeHigh << 32) | - file_info_2.nFileSizeLow; - if (size_1 != size_2) { - error(L"Size for %ls (%"PRIu64") differs from size for %ls (%"PRIu64")", - path_1, size_1, path_2, size_2); + attribs = file_info_1.dwFileAttributes; + + if (!(attribs & FILE_ATTRIBUTE_DIRECTORY)) { + size_1 = ((u64)file_info_1.nFileSizeHigh << 32) | + file_info_1.nFileSizeLow; + size_2 = ((u64)file_info_2.nFileSizeHigh << 32) | + file_info_2.nFileSizeLow; + if (size_1 != size_2) { + error(L"Size for %ls (%"PRIu64") differs from size for %ls (%"PRIu64")", + path_1, size_1, path_2, size_2); + } } if (file_info_1.nNumberOfLinks != file_info_2.nNumberOfLinks) { error(L"Number of links for %ls (%u) differs from number " @@ -547,8 +551,6 @@ tree_cmp(wchar_t *path_1, size_t path_1_len, wchar_t *path_2, size_t path_2_len) error(L"Last write times on %ls and %ls differ", path_1, path_2); - attribs = file_info_1.dwFileAttributes; - cmp_security(path_1, path_2); cmp_streams(path_1, path_1_len, path_2, path_2_len); if (attribs & FILE_ATTRIBUTE_REPARSE_POINT)