Fossil

Check-in [ecedaf93]
Login

Check-in [ecedaf93]

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

Overview
Comment:When generating ZIP archives, files with zero bytes are 'Stored', not 'Deflated'.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: ecedaf93991c66a4a9d311f0f97a62253f51a7be
User & Date: mistachkin 2016-01-07 18:22:18
Context
2016-01-09
18:56
Fix the 'file1' test so that it can (only) run outside of the Fossil checkout. ... (check-in: 19c21639 user: mistachkin tags: trunk)
2016-01-07
18:22
When generating ZIP archives, files with zero bytes are 'Stored', not 'Deflated'. ... (check-in: ecedaf93 user: mistachkin tags: trunk)
2016-01-06
19:49
Do not set the directory permission bit on empty files when creating a ZIP archive. ... (check-in: 3d5cf48b user: mistachkin tags: trunk)
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/zip.c.
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
  char zBuf[100];
  char zOutBuf[100000];

  /* Fill in as much of the header as we know.
  */
  nBlob = pFile ? blob_size(pFile) : 0;
  if( pFile ){ /* This is a file, possibly empty... */
    iMethod = 8;
    switch( mPerm ){
      case PERM_LNK:   iMode = 0120755;   break;
      case PERM_EXE:   iMode = 0100755;   break;
      default:         iMode = 0100644;   break;
    }
  }else{       /* This is a directory, no blob... */
    iMethod = 0;







|







141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
  char zBuf[100];
  char zOutBuf[100000];

  /* Fill in as much of the header as we know.
  */
  nBlob = pFile ? blob_size(pFile) : 0;
  if( pFile ){ /* This is a file, possibly empty... */
    iMethod = (nBlob>0) ? 8 : 0; /* Cannot compress zero bytes. */
    switch( mPerm ){
      case PERM_LNK:   iMode = 0120755;   break;
      case PERM_EXE:   iMode = 0100755;   break;
      default:         iMode = 0100644;   break;
    }
  }else{       /* This is a directory, no blob... */
    iMethod = 0;