summaryrefslogtreecommitdiff
path: root/src/blob.c
diff options
context:
space:
mode:
authorTimo Teräs <timo.teras@iki.fi>2014-11-01 19:15:17 +0200
committerTimo Teräs <timo.teras@iki.fi>2014-11-01 19:17:06 +0200
commit36d5b91495e22fe8425277f2d793fd4a284ee2b6 (patch)
treed6b9bea1ef1d4ab8ed1374c193a3c85b5968bfea /src/blob.c
parentbb1ac2557deb006fd2d6c1554cee329b5f0e44ba (diff)
downloadapk-tools-36d5b91495e22fe8425277f2d793fd4a284ee2b6.tar.gz
apk-tools-36d5b91495e22fe8425277f2d793fd4a284ee2b6.tar.bz2
apk-tools-36d5b91495e22fe8425277f2d793fd4a284ee2b6.tar.xz
apk-tools-36d5b91495e22fe8425277f2d793fd4a284ee2b6.zip
support extended pax header in tar extractor
Diffstat (limited to 'src/blob.c')
-rw-r--r--src/blob.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/blob.c b/src/blob.c
index fc21467..f1fe221 100644
--- a/src/blob.c
+++ b/src/blob.c
@@ -492,6 +492,15 @@ err:
*b = APK_BLOB_NULL;
}
+int apk_blob_pull_blob_match(apk_blob_t *b, apk_blob_t match)
+{
+ if (b->len < match.len) return 0;
+ if (memcmp(b->ptr, match.ptr, match.len) != 0) return 0;
+ b->ptr += match.len;
+ b->len -= match.len;
+ return 1;
+}
+
static unsigned char b64decode[] = {
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,