Changeset View
Changeset View
Standalone View
Standalone View
usr.bin/unzip/unzip.c
Show First 20 Lines • Show All 379 Lines • ▼ Show 20 Lines | |||||
/* | /* | ||||
* Extract a directory. | * Extract a directory. | ||||
*/ | */ | ||||
static void | static void | ||||
extract_dir(struct archive *a, struct archive_entry *e, const char *path) | extract_dir(struct archive *a, struct archive_entry *e, const char *path) | ||||
{ | { | ||||
int mode; | int mode; | ||||
/* | |||||
* Dropbox likes to create '/' directory entries, just ignore | |||||
* such junk. | |||||
*/ | |||||
if (*path == '\0') | |||||
return; | |||||
mode = archive_entry_mode(e) & 0777; | mode = archive_entry_mode(e) & 0777; | ||||
if (mode == 0) | if (mode == 0) | ||||
mode = 0755; | mode = 0755; | ||||
/* | /* | ||||
* Some zipfiles contain directories with weird permissions such | * Some zipfiles contain directories with weird permissions such | ||||
* as 0644 or 0444. This can cause strange issues such as being | * as 0644 or 0444. This can cause strange issues such as being | ||||
* unable to extract files into the directory we just created, or | * unable to extract files into the directory we just created, or | ||||
▲ Show 20 Lines • Show All 671 Lines • Show Last 20 Lines |