From dbd539bc337b94a290f2fbd049a46851a656bfeb Mon Sep 17 00:00:00 2001 From: David Anderson Date: Sun, 8 Jul 2007 04:03:11 +0000 Subject: [PATCH] fix to dir_size() svn path=/trunk/boinc/; revision=13119 --- lib/filesys.C | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/filesys.C b/lib/filesys.C index 8ef1072e73..8472f11128 100755 --- a/lib/filesys.C +++ b/lib/filesys.C @@ -356,9 +356,11 @@ int clean_out_dir(const char* dirpath) { // int dir_size(const char* dirpath, double& size, bool recurse) { #ifdef WIN32 + char path2[_MAX_PATH]; + sprintf(path2, "%s/*", dirpath); size = 0.0; WIN32_FIND_DATA findData; - HANDLE hFind = ::FindFirstFile(dirpath, &findData); + HANDLE hFind = ::FindFirstFile(path2, &findData); if (INVALID_HANDLE_VALUE != hFind) { do { if (findData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) { @@ -368,7 +370,7 @@ int dir_size(const char* dirpath, double& size, bool recurse) { double dsize = 0; char buf[_MAX_PATH]; - ::sprintf(buf, "%s\\%s", dirpath, findData.cFileName); + ::sprintf(buf, "%s/%s", dirpath, findData.cFileName); dir_size(buf, dsize, recurse); size += dsize; } else {