/ Check-in [16bba865]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Avoid harmless left-shifts of negative numbers in the zipfile extension when building ZIP archives of files with pre-DOS dates.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 16bba8650cc24a0fd606944422bb31f2b8bdbe0a5a483678989e400b751eab4d
User & Date: drh 2018-03-10 12:53:20
Context
2018-03-10
13:21
Improved error messages from the zipfile extension. check-in: f634a7e3 user: drh tags: trunk
12:53
Avoid harmless left-shifts of negative numbers in the zipfile extension when building ZIP archives of files with pre-DOS dates. check-in: 16bba865 user: drh tags: trunk
12:34
Fix the zipfile extension so that it is able to create symbolic link entries in the ZIP file even on systems like Win32 that do not support symbolic links on the native filesystem. check-in: 2a4493f4 user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to ext/misc/zipfile.c.

   747    747     mon = (E<14 ? E-1 : E-13);
   748    748     yr = mon>2 ? C-4716 : C-4715;
   749    749   
   750    750     hr = (mUnixTime % (24*60*60)) / (60*60);
   751    751     min = (mUnixTime % (60*60)) / 60;
   752    752     sec = (mUnixTime % 60);
   753    753   
   754         -  pCds->mDate = (u16)(day + (mon << 5) + ((yr-1980) << 9));
   755         -  pCds->mTime = (u16)(sec/2 + (min<<5) + (hr<<11));
          754  +  if( yr>=1980 ){
          755  +    pCds->mDate = (u16)(day + (mon << 5) + ((yr-1980) << 9));
          756  +    pCds->mTime = (u16)(sec/2 + (min<<5) + (hr<<11));
          757  +  }else{
          758  +    pCds->mDate = pCds->mTime = 0;
          759  +  }
   756    760   
   757    761     assert( mUnixTime<315507600 
   758    762          || mUnixTime==zipfileMtime(pCds) 
   759    763          || ((mUnixTime % 2) && mUnixTime-1==zipfileMtime(pCds)) 
   760    764          /* || (mUnixTime % 2) */
   761    765     );
   762    766   }