wininet [2/2]: Fix error checking for FtpGetCurrentDirectoryW

Dan Kegel dank at
Thu Nov 29 07:56:18 CST 2007

Hi Zac,
you wrote

* Fixed errors in error checking in FtpGetCurrentDirectoryW in wininet/ftp.c

It's probably a good idea to explain what real-world
problem this fixes.  One good way to do that is to
submit a test first that fails, with todo(wine) around
the failing part, and then submit a second patch which
fixes the problem and removes the todo(wine) from the test.

-    if (NULL == lpwfs || WH_HFTPSESSION != lpwfs->hdr.htype)
+    if ( lpwfs == NULL || WH_HFTPSESSION != lpwfs->hdr.htype )

Why did you make this change?  It doesn't fix anything,
and it removes an old coder's anti-typo-measure of putting
the const on the left hand of an equality test.  Please remove
this hunk.

-    if (lpwfs->download_in_progress != NULL)
+	if ( lpszCurrentDirectory == NULL || *lpdwCurrentDirectory == NULL )

You switched to tabs, tsk.  Also, you changed whitespace
style.   Always try to match the file's existing style.
- Dan
Wine for Windows ISVs:

More information about the wine-devel mailing list