Bug in NT_TZBUG_WORKAROUND

"Cosmin T" <[email protected]> Thu, 12 Feb 2004 17:55:36 -0500
Newsgroups gmane.comp.archivers.info-zip
Message-ID <[email protected]>
Hi,

I noticed that some file times created by zip and unzip under NTFS/Win2000 
are incorrect.

The TZBUG workaround makes the time correction only if the filesystem stores 
the time locally (FAT, FAT32), but it should always do it. This is why I get 
correct time stamps on FAT, but not on NTFS. I looked inside the source code 
of utime() from the MS C Runtime Lib, and it does not treat file systems 
differently, either.

The quick and dirty fix shown below solves the problem in unzip551c. An 
elegant solution should actually be a code simplification, and I can provide 
it if you give me a few days.

I would say that "NT TZ bug" is a misnomer. It's more like "Win32 TZ bug", 
even though M$ says it's a design decision (to which I disagree, but that 
couldn't matter less...) and I guess it will stay that way forever. MS CRTL 
makes the proper adjustment in the implementation of mktime() and 
localtime(). So, I personally think it's a good idea to even remove the 
NT_TZBUG_WORKAROUND macro noise and set the time adjustment in stone.

Note: I could not test this on NTFS/WinNT4, or NTFS/WinXP, but I believe the 
behavior is the same.

Best regards,
Cosmin


--- win32/win32.c~    Sat May 10 13:10:46 2003
+++ win32/win32.c     Thu Feb 12 13:30:29 2004
@@ -651,7 +651,11 @@

static int FStampIsLocTime(__GPRO__ const char *path)
{
+#if 0
     return (NTQueryVolInfo(__G__ path) ? G.lastVolLocTim : FALSE);
+#else
+    return 1;
+#endif
}

#endif /* USE_EF_UT_TIME || NT_TZBUG_WORKAROUND || TIMESTAMP */

_________________________________________________________________
Tired of spam? Get advanced junk mail protection with MSN 8.  
http://join.msn.com/?page=dept/bcomm&pgmarket=en-ca&RU=http%3a%2f%2fjoin.msn.com%2f%3fpage%3dmisc%2fspecialoffers%26pgmarket%3den-ca