From: Tim Kientzle Date: Sat, 15 Jan 2011 04:18:48 +0000 (-0500) Subject: Issue 127: Always initialize restore_pwd so it always gets X-Git-Tag: v3.0.0a~762 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fa32d13746ee7e9c2c0a08282949756ffdc61ba7;p=thirdparty%2Flibarchive.git Issue 127: Always initialize restore_pwd so it always gets cleaned up correctly, even on platforms that don't use edit_deep_directories. SVN-Revision: 2888 --- diff --git a/libarchive/archive_write_disk.c b/libarchive/archive_write_disk.c index 8b974eab5..bcfec37a6 100644 --- a/libarchive/archive_write_disk.c +++ b/libarchive/archive_write_disk.c @@ -409,6 +409,7 @@ _archive_write_disk_header(struct archive *_a, struct archive_entry *entry) a->fd = -1; a->fd_offset = 0; a->offset = 0; + a->restore_pwd = -1; a->uid = a->user_uid; a->mode = archive_entry_mode(a->entry); if (archive_entry_size_is_set(a->entry)) @@ -1030,8 +1031,6 @@ edit_deep_directories(struct archive_write_disk *a) int ret; char *tail = a->name; - a->restore_pwd = -1; - /* If path is short, avoid the open() below. */ if (strlen(tail) <= PATH_MAX) return;