add process snapshots as a file type. also, correct bug in identifying pem certificates. unfortunately, ghostscript has a leading null, so the length field can't be eliminated. Reference: /n/sources/patch/applied/filesnapfs Date: Tue Dec 18 19:55:47 CET 2007 Signed-off-by: quanstro@quanstro.net --- /sys/src/cmd/file.c Tue Dec 18 19:54:29 2007 +++ /sys/src/cmd/file.c Tue Dec 18 19:54:20 2007 @@ -803,23 +803,27 @@ ".tr", "troff input", 3, "text/troff", "vac:", "venti score", 4, "text/plain", "-----BEGIN CERTIFICATE-----\n", - "pem certificate", 3, "text/plain", + "pem certificate", -1, "text/plain", "-----BEGIN TRUSTED CERTIFICATE-----\n", - "pem trusted certificate", 3, "text/plain", + "pem trusted certificate", -1, "text/plain", "-----BEGIN X509 CERTIFICATE-----\n", - "pem x.509 certificate", 3, "text/plain", - "subject=/C=", "pem certificate with header", 3, "text/plain", + "pem x.509 certificate", -1, "text/plain", + "subject=/C=", "pem certificate with header", -1, "text/plain", + "process snapshot ", "process snapshot", -1, "application/snapfs", 0,0,0,0 }; int istring(void) { - int i; + int i, l; struct FILE_STRING *p; for(p = file_string; p->key; p++) { - if(nbuf >= p->length && !memcmp(buf, p->key, p->length)) { + l = p->length; + if(l == -1) + l = strlen(p->key); + if(nbuf >= l && !memcmp(buf, p->key, l)) { if(mime) print("%s\n", p->mime); else