[Toybox] [PATCH] Follow RFC1952 when consuming gzip header

Puck Meerburg puck at puck.moe
Mon Dec 14 04:47:13 PST 2020


On Mon, Dec 14, 2020 at 02:10:51AM -0600, Rob Landley wrote:
> Applied, but do you have a test I can add to the test suite? (Or just send me
> the smallest file you can I can use to make a test?)

I attached a test case, thanks for applying the fix :)

Regards,
Puck.
-------------- next part --------------
>From dd30bad0c530bc6bcabf385de48eb47e3d029b38 Mon Sep 17 00:00:00 2001
From: Puck Meerburg <puck at puck.moe>
Date: Mon, 14 Dec 2020 12:37:30 +0000
Subject: [PATCH] Add test for FEXTRA flag on gunzip

---
 tests/gunzip.test | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/tests/gunzip.test b/tests/gunzip.test
index 9f9ef5eb..bf9b9834 100644
--- a/tests/gunzip.test
+++ b/tests/gunzip.test
@@ -21,6 +21,13 @@ testing "no files (stdin to stdout)" "cat f.gz | gunzip > f &&
     test -f f.gz && cat f" "hello world\n" "" ""
 rm -f f f.gz
 
+# test FEXTRA support
+echo "1f8b08040000000000ff04000000ffff4bcbcfe70200a865327e04000000" | xxd -r -p > f1.gz
+testing "FEXTRA flag skipped properly" "gunzip f1.gz &&
+    ! test -f f1.gz && test -f f1 &&
+    cat f1" "foo\n" "" ""
+rm -f f1 f1.gz
+
 # -c	Output to stdout
 echo -n "foo " | gzip > f1.gz
 echo "bar" | gzip > f2.gz
-- 
2.26.2



More information about the Toybox mailing list