tChange directory after opening package - pm - barely a pack manager
HTML git clone git://z3bra.org/pm
DIR Log
DIR Files
DIR Refs
DIR README
DIR LICENSE
---
DIR commit 247e62ef65fa6934b4952002822c4ec5085cb286
DIR parent 84b7654d682411377a6469d7bb79a4aca45a4039
HTML Author: z3bra <willyatmailoodotorg>
Date: Wed, 23 Dec 2015 19:25:10 +0100
Change directory after opening package
Diffstat:
M pm.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
---
DIR diff --git a/pm.c b/pm.c
t@@ -184,12 +184,6 @@ unpack(char *root, const char *in)
|ARCHIVE_EXTRACT_NO_OVERWRITE
|ARCHIVE_EXTRACT_SECURE_NODOTDOT;
- /* extract the package at the specified root */
- if (chdir(root) < 0) {
- perror("chdir");
- return -1;
- }
-
a = archive_read_new();
archive_read_support_filter_all(a);
archive_read_support_format_all(a);
t@@ -202,6 +196,12 @@ unpack(char *root, const char *in)
if (r != ARCHIVE_OK)
return r;
+ /* extract the package at the specified root */
+ if (chdir(root) < 0) {
+ perror("chdir");
+ return -1;
+ }
+
while (archive_read_next_header(a, &e) != ARCHIVE_EOF) {
r = archive_write_header(w, e);