shithub: riscv

Download patch

ref: 403dee333ec4f07fd27b8173d3425fee1be297cd
parent: a7768bd61fc9cddd7648b672a3150dc0fd8d186d
author: cinap_lenrek <cinap_lenrek@centraldogma>
date: Sat Oct 15 20:45:08 EDT 2011

file: recognize zlib compression

--- a/sys/src/cmd/file.c
+++ b/sys/src/cmd/file.c
@@ -1180,6 +1180,9 @@
 		if(buf[0]=='B' && buf[1]=='Z' && buf[2]=='h')
 			print(mime ? "application/x-bzip2" : "bzip2 compressed\n");
 		else
+		if(buf[0]==0x78 && buf[1]==0x9c)
+			print(mime ? "application/x-deflate" : "zlib compressed\n");
+		else
 			print(mime ? OCTET : "encrypted\n");
 		return 1;
 	}