Mail Archives: cygwin-developers/1998/10/24/10:05:21
In syscalls.cc the function `num_entries()' is only used,
to count links to directories. Unfortunately, the link
count is made from a count of _all_ entries in the
directory. If this function would count only the entries,
which are also directories, the link count would be
correct. This leads to the following patch.
Regards,
Corinna
--- syscalls.cc.orig Fri Oct 23 09:39:59 1998
+++ syscalls.cc Sat Oct 24 17:22:59 1998
@@ -1172,7 +1172,8 @@ num_entries (const char *win32_name)
count ++;
while (FindNextFileA (handle, &buf))
{
- count ++;
+ if ((buf.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) != 0)
+ count ++;
}
FindClose (handle);
return count;
- Raw text -