Quote:
Originally Posted by Cheeseh
Heya
I found a "bug" in the FindDirectory code of good ol' botman's directory searching I used from HPB_bot code.
should be this
Code:
while ( (pFindFileData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) != FILE_ATTRIBUTE_DIRECTORY )
|
Well.. not quite..
It MAY work but this would be by-chance.
dwFileAttributes is a bit mask and we are testing for the bit
FILE_ATTRIBUTE_DIRECTORY,
Thus we AND them but then TEST FOR 0 OR NON 0.
if (!(fd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY))
//code looking for files go here..
if ((fd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY))
// code looking for dirs go here..
>edit<
Yup, yup, you guys are correct.
Either way will work, but if you want to use positive logic you have to do it your way.