Yesssss! got it, stupid mistake.... It should be... if ((le == ERROR_NO_MORE_FILES) || (le == ERROR_FILE_NOT_FOUND)) return LB_ERR;
Thanks, Krishna -----Original Message----- From: Dimitrie O. Paun [mailto:dpaun@rogers.com] Sent: Tuesday, June 22, 2004 2:01 PM To: Krishna Murthy Cc: 'Alexandre Julliard'; wine-devel@winehq.org Subject: Re: LISTBOX_Directory() returns LB_OKAY for invalid directory / f ilen ame
On Tue, Jun 22, 2004 at 11:08:28AM -0700, Krishna Murthy wrote:
The 'le' is an integer value and not a bitwise value. This means it could have only one error condition at a time.
Right. Because of this fact:
if ((le != ERROR_NO_MORE_FILES) || (le != ERROR_FILE_NOT_FOUND)) return LB_ERR;
Will always return LB_ERR. Proof:
(le != ERROR_NO_MORE_FILES) || (le != ERROR_FILE_NOT_FOUND) ## by deMorgan's Law == !((le == ERROR_NO_MORE_FILES) && (le == ERROR_FILE_NOT_FOUND)) ## by transitivity == !(ERROR_NO_MORE_FILES == ERROR_FILE_NOT_FOUND) ## by the definition of these error codes == !(18 == 2) ## different numbers are not equal == !(FALSE) ## by negation == TRUE
;)
-- Dimi.
P.S. I haven't done a formal proof since I was doing my M.Sc. at UofT :)
Krishna Murthy Krishna.Murthy@guptaworldwide.com writes:
Yesssss! got it, stupid mistake.... It should be... if ((le == ERROR_NO_MORE_FILES) || (le == ERROR_FILE_NOT_FOUND)) return LB_ERR;
That makes more sense, but it still looks wrong, I don't see why you would ignore all other errors. I suspect what you are really trying to do is to revert the change in rev 1.94, but this causes other problems (cf. bug 1435). I think you'll have to write a regression test for that one.