Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utcs!mnetor!seismo!lll-crg!lll-lcc!pyramid!decwrl!turtlevax!ken From: ken@turtlevax.UUCP Newsgroups: net.bugs.4bsd Subject: bug in 4.3bsd file.c Message-ID: <1192@turtlevax.UUCP> Date: Thu, 17-Jul-86 06:16:01 EDT Article-I.D.: turtleva.1192 Posted: Thu Jul 17 06:16:01 1986 Date-Received: Fri, 18-Jul-86 01:12:25 EDT Organization: CIMLINC, Inc. @ Menlo Park, CA Lines: 32 Keywords: parenthesize The 4.3bsd code for file.c has a bug in that compressed files are not properly recognized. Laziness is the cause of the bug, manifested by not properly parenthesizing compound logical expressions. A context diff follows: *** /usr/src/usr.bin/file.c.old Thu Jul 17 03:06:02 1986 --- /usr/src/usr.bin/file.c Thu Jul 17 03:07:35 1986 *************** *** 174,182 **** return; } ! if (buf[0] == '#' && buf[1] == '!' && shellscript(buf+2, &mbuf)) return; ! if (buf[0] == '\037' && buf[1] == '\235') { if (buf[2]&0x80) printf("block "); printf("compressed %d bit code data\n", buf[2]&0x1f); --- 174,182 ---- return; } ! if ((buf[0] == '#') && (buf[1] == '!') && shellscript(buf+2, &mbuf)) return; ! if ((buf[0] == '\037') && (buf[1] == '\235')) { if (buf[2]&0x80) printf("block "); printf("compressed %d bit code data\n", buf[2]&0x1f); -- Ken Turkowski @ CIMLINC, Menlo Park, CA UUCP: {amd,decwrl,hplabs,seismo}!turtlevax!ken ARPA: turtlevax!ken@DECWRL.DEC.COM