commit 7e2d562bd304fc849e215f2a097e21af20f787a0
parent 663e76d9ba964d97e384b5960dd0359ab9b52308
Author: sin <sin@2f30.org>
Date: Mon, 16 Jun 2014 08:24:57 +0100
Only use ARCHIVE_EXTRACT_UNLINK if -f is set
No functional change.
Diffstat:
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/db.c b/db.c
@@ -389,8 +389,9 @@ dbpkginstall(struct db *db, const char *file)
return -1;
}
flags = ARCHIVE_EXTRACT_OWNER | ARCHIVE_EXTRACT_PERM |
- ARCHIVE_EXTRACT_TIME | ARCHIVE_EXTRACT_UNLINK |
- ARCHIVE_EXTRACT_SECURE_NODOTDOT;
+ ARCHIVE_EXTRACT_TIME | ARCHIVE_EXTRACT_SECURE_NODOTDOT;
+ if (fflag == 1)
+ flags |= ARCHIVE_EXTRACT_UNLINK;
r = archive_read_extract(ar, entry, flags);
if (r != ARCHIVE_OK && r != ARCHIVE_WARN)
weprintf("archive_read_extract %s: %s\n",