* fhandler_disk_file.cc (path_conv::ndisk_links): Fix potential off-by-one
problem when first file in a directory is a directory.
This commit is contained in:
parent
a98a001169
commit
e306c058c7
@ -1,3 +1,8 @@
|
|||||||
|
2003-09-13 Christopher Faylor <cgf@redhat.com>
|
||||||
|
|
||||||
|
* fhandler_disk_file.cc (path_conv::ndisk_links): Fix potential
|
||||||
|
off-by-one problem when first file in a directory is a directory.
|
||||||
|
|
||||||
2003-09-13 Pierre Humblet <pierre.humblet@ieee.org>
|
2003-09-13 Pierre Humblet <pierre.humblet@ieee.org>
|
||||||
|
|
||||||
* include/sys/cygwin.h: Rename PID_UNUSED to PID_MAP_RW.
|
* include/sys/cygwin.h: Rename PID_UNUSED to PID_MAP_RW.
|
||||||
|
@ -66,7 +66,7 @@ path_conv::ndisk_links (DWORD nNumberOfLinks)
|
|||||||
if (nNumberOfLinks > 1)
|
if (nNumberOfLinks > 1)
|
||||||
saw_dot--;
|
saw_dot--;
|
||||||
else
|
else
|
||||||
while (FindNextFileA (h, &buf))
|
do
|
||||||
{
|
{
|
||||||
if (buf.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
|
if (buf.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
|
||||||
count++;
|
count++;
|
||||||
@ -75,6 +75,7 @@ path_conv::ndisk_links (DWORD nNumberOfLinks)
|
|||||||
|| (buf.cFileName[1] == '.' && buf.cFileName[2] == '\0')))
|
|| (buf.cFileName[1] == '.' && buf.cFileName[2] == '\0')))
|
||||||
saw_dot--;
|
saw_dot--;
|
||||||
}
|
}
|
||||||
|
while (FindNextFileA (h, &buf));
|
||||||
FindClose (h);
|
FindClose (h);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user