From b3f23d4c6a34b190d3fe0b73ed3c25e4af611749 Mon Sep 17 00:00:00 2001 From: Glenn L McGrath Date: Wed, 11 Apr 2001 16:31:20 +0000 Subject: [PATCH] Seek to start of an entry inside an ar file --- libbb/seek_ared_file.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 libbb/seek_ared_file.c diff --git a/libbb/seek_ared_file.c b/libbb/seek_ared_file.c new file mode 100644 index 000000000..67c789d6d --- /dev/null +++ b/libbb/seek_ared_file.c @@ -0,0 +1,17 @@ +#include +#include +#include "libbb.h" + +extern int seek_ared_file(FILE *in_file, ar_headers_t *headers, const char *tar_gz_file) +{ + /* find the headers for the specified .tar.gz file */ + while (headers->next != NULL) { + if (strcmp(headers->name, tar_gz_file) == 0) { + fseek(in_file, headers->offset, SEEK_SET); + return(EXIT_SUCCESS); + } + headers = headers->next; + } + + return(EXIT_FAILURE); +} \ No newline at end of file