Fossil SCM

Support symlinks in ZIP files.

dmitry 2011-08-24 19:12 symlinks
Commit 16da26c5858f1152eadf024e550c06bb2b4be490
1 file changed +6 -1
+6 -1
--- src/zip.c
+++ src/zip.c
@@ -139,11 +139,16 @@
139139
/* Fill in as much of the header as we know.
140140
*/
141141
nBlob = pFile ? blob_size(pFile) : 0;
142142
if( nBlob>0 ){
143143
iMethod = 8;
144
- iMode = ( mPerm == 1 ) ? 0100755 : 0100644; //TODO(dchest): handle links
144
+ if( mPerm==1 )
145
+ iMode = 0100755; /* executable */
146
+ else if( mPerm==2 )
147
+ iMode = 0120755; /* symlink */
148
+ else
149
+ iMode = 0100644; /* normal file */
145150
}else{
146151
iMethod = 0;
147152
iMode = 040755;
148153
}
149154
nameLen = strlen(zName);
150155
--- src/zip.c
+++ src/zip.c
@@ -139,11 +139,16 @@
139 /* Fill in as much of the header as we know.
140 */
141 nBlob = pFile ? blob_size(pFile) : 0;
142 if( nBlob>0 ){
143 iMethod = 8;
144 iMode = ( mPerm == 1 ) ? 0100755 : 0100644; //TODO(dchest): handle links
 
 
 
 
 
145 }else{
146 iMethod = 0;
147 iMode = 040755;
148 }
149 nameLen = strlen(zName);
150
--- src/zip.c
+++ src/zip.c
@@ -139,11 +139,16 @@
139 /* Fill in as much of the header as we know.
140 */
141 nBlob = pFile ? blob_size(pFile) : 0;
142 if( nBlob>0 ){
143 iMethod = 8;
144 if( mPerm==1 )
145 iMode = 0100755; /* executable */
146 else if( mPerm==2 )
147 iMode = 0120755; /* symlink */
148 else
149 iMode = 0100644; /* normal file */
150 }else{
151 iMethod = 0;
152 iMode = 040755;
153 }
154 nameLen = strlen(zName);
155

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button