@@ -209,44 +209,6 @@ vips__archive_new_to_target(VipsTarget *target,
209
209
return archive ;
210
210
}
211
211
212
- static int
213
- vips__archive_mkdir_zip (VipsArchive * archive , const char * dirname )
214
- {
215
- struct archive_entry * entry ;
216
-
217
- vips__worker_lock (vips_libarchive_mutex );
218
-
219
- if (!(entry = archive_entry_new ())) {
220
- vips_error ("archive" , "%s" , _ ("unable to create entry" ));
221
- g_mutex_unlock (vips_libarchive_mutex );
222
- return -1 ;
223
- }
224
-
225
- char * path ;
226
-
227
- path = g_build_filename (archive -> base_dirname , dirname , NULL );
228
-
229
- archive_entry_set_pathname (entry , path );
230
- archive_entry_set_mode (entry , S_IFDIR | 0755 );
231
-
232
- if (archive_write_header (archive -> archive , entry )) {
233
- char * utf8name = g_filename_display_name (path );
234
- vips_error ("archive" , _ ("unable to add directory \"%s\", %s" ),
235
- utf8name , archive_error_string (archive -> archive ));
236
- g_free (utf8name );
237
- g_free (path );
238
- archive_entry_free (entry );
239
- g_mutex_unlock (vips_libarchive_mutex );
240
- return -1 ;
241
- }
242
-
243
- archive_entry_free (entry );
244
- g_free (path );
245
- g_mutex_unlock (vips_libarchive_mutex );
246
-
247
- return 0 ;
248
- }
249
-
250
212
static int
251
213
vips__archive_mkdir_file (VipsArchive * archive , const char * dirname )
252
214
{
@@ -277,9 +239,13 @@ vips__archive_mkdir_file(VipsArchive *archive, const char *dirname)
277
239
int
278
240
vips__archive_mkdir (VipsArchive * archive , const char * dirname )
279
241
{
280
- return ((archive -> archive )
281
- ? vips__archive_mkdir_zip
282
- : vips__archive_mkdir_file )(archive , dirname );
242
+ /* The ZIP format maintains a hierarchical structure, avoiding
243
+ * the need to create individual entries for each (sub-)directory.
244
+ */
245
+ if (archive -> archive )
246
+ return 0 ;
247
+
248
+ return vips__archive_mkdir_file (archive , dirname );
283
249
}
284
250
285
251
static int
0 commit comments