Mail Archives: cygwin-developers/1998/10/24/18:39:18
On Sat, Oct 24, 1998 at 06:50:36PM +0200, Corinna Vinschen wrote:
>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;
I can't believe that no one has noticed this before!
Applied.
cgf
- Raw text -