summaryrefslogtreecommitdiff
path: root/archival/libunarchive
diff options
context:
space:
mode:
authorGlenn L McGrath2002-10-19 10:40:55 +0000
committerGlenn L McGrath2002-10-19 10:40:55 +0000
commit61b7904afdf2fca21e4d6a4f70a73d1079f8f877 (patch)
tree1043011878a4948559389074556e24940a71cfa8 /archival/libunarchive
parentc5c1a8a112ebae29862a902e6e511b392c59da74 (diff)
downloadbusybox-61b7904afdf2fca21e4d6a4f70a73d1079f8f877.zip
busybox-61b7904afdf2fca21e4d6a4f70a73d1079f8f877.tar.gz
Update dpkg to use new unarchive code
Diffstat (limited to 'archival/libunarchive')
-rw-r--r--archival/libunarchive/Makefile.in2
-rw-r--r--archival/libunarchive/data_extract_all_prefix.c23
-rw-r--r--archival/libunarchive/data_extract_to_buffer.c11
3 files changed, 36 insertions, 0 deletions
diff --git a/archival/libunarchive/Makefile.in b/archival/libunarchive/Makefile.in
index e559cb4..87c888b 100644
--- a/archival/libunarchive/Makefile.in
+++ b/archival/libunarchive/Makefile.in
@@ -26,7 +26,9 @@ LIBUNARCHIVE-y:= \
\
data_skip.o \
data_extract_all.o \
+ data_extract_all_prefix.o \
data_extract_to_stdout.o \
+ data_extract_to_buffer.o \
\
filter_accept_all.o \
filter_accept_list.o \
diff --git a/archival/libunarchive/data_extract_all_prefix.c b/archival/libunarchive/data_extract_all_prefix.c
new file mode 100644
index 0000000..e4e93fc
--- /dev/null
+++ b/archival/libunarchive/data_extract_all_prefix.c
@@ -0,0 +1,23 @@
+#include <sys/types.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <stdlib.h>
+#include <string.h>
+#include <utime.h>
+#include <unistd.h>
+#include <stdlib.h>
+#include "libbb.h"
+#include "unarchive.h"
+
+extern void data_extract_all_prefix(archive_handle_t *archive_handle)
+{
+ char *name_ptr = archive_handle->file_header->name;
+
+ name_ptr += strspn(name_ptr, "./");
+ if (name_ptr[0] != '\0') {
+ archive_handle->file_header->name = xmalloc(strlen(archive_handle->buffer) + 2 + strlen(name_ptr));
+ sprintf(archive_handle->file_header->name, "%s%s", archive_handle->buffer, name_ptr);
+ data_extract_all(archive_handle);
+ }
+ return;
+}
diff --git a/archival/libunarchive/data_extract_to_buffer.c b/archival/libunarchive/data_extract_to_buffer.c
new file mode 100644
index 0000000..02ee4b3
--- /dev/null
+++ b/archival/libunarchive/data_extract_to_buffer.c
@@ -0,0 +1,11 @@
+#include <stdlib.h>
+#include <stdio.h>
+#include "unarchive.h"
+#include "libbb.h"
+
+extern void data_extract_to_buffer(archive_handle_t *archive_handle)
+{
+ archive_handle->buffer = xmalloc(archive_handle->file_header->size + 1);
+
+ xread_all(archive_handle->src_fd, archive_handle->buffer, archive_handle->file_header->size);
+}