Skip to content

Commit 8eb6435

Browse files
committed
CHANGE: modified verbosity of the gzip codec
1 parent 1746572 commit 8eb6435

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/mezz/codec-gzip.reb

+6-6
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ REBOL [
33
purpose: "Lossless compressed data format compatible with GZIP utility"
44
name: 'codec-gzip
55
author: rights: "Oldes"
6-
version: 0.0.1
6+
version: 0.0.2
77
specification: https://tools.ietf.org/html/rfc1952
88
]
99

@@ -13,7 +13,10 @@ register-codec [
1313
title: "Lossless compressed data format compatible with GZIP utility."
1414
suffixes: [%.gz]
1515
decode: function[data [binary!]] [
16-
if verbose > 0 [ identify data ]
16+
if verbose > 0 [
17+
print ["^[[1;32mDecode GZIP data^[[m (^[[1m" length? data "^[[mbytes )"]
18+
identify data
19+
]
1720
decompress data 'gzip
1821
]
1922

@@ -23,9 +26,6 @@ register-codec [
2326

2427
identify: function [data [binary!]][
2528
if 10 > length? data [return none]
26-
if verbose > 0 [
27-
print ["^[[1;32mDecode GZIP data^[[m (^[[1m" length? data "^[[mbytes )"]
28-
]
2929
bin: binary data
3030
binary/read bin [
3131
id: UI16 ; Magick: #{1F8B}
@@ -56,7 +56,7 @@ register-codec [
5656
;checksum/part bin/buffer-write 'CRC32 index? bin/buffer
5757
crc16: binary/read bin 'UI16LE
5858
]
59-
if verbose > 0 [
59+
if verbose > 1 [
6060
print ["^[[32mModified: ^[[0;1m" mtime "^[[m"]
6161
print ["^[[32mExtra flags: ^[[0;1m" xfl "^[[m"]
6262
print ["^[[32mOperating system: ^[[0;1m" os "^[[m"]

0 commit comments

Comments
 (0)