]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
Issue 127: Always initialize restore_pwd so it always gets
authorTim Kientzle <kientzle@gmail.com>
Sat, 15 Jan 2011 04:18:48 +0000 (23:18 -0500)
committerTim Kientzle <kientzle@gmail.com>
Sat, 15 Jan 2011 04:18:48 +0000 (23:18 -0500)
cleaned up correctly, even on platforms that don't use edit_deep_directories.

SVN-Revision: 2888

libarchive/archive_write_disk.c

index 8b974eab5ddfb7317407c043ab75662b5af7e3aa..bcfec37a6c11649491d8c3f816265e8278cebb86 100644 (file)
@@ -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;