bug in 4.3bsd file.c

ken at turtlevax.UUCP ken at turtlevax.UUCP
Thu Jul 17 20:16:01 AEST 1986


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 at DECWRL.DEC.COM



More information about the Comp.bugs.4bsd.ucb-fixes mailing list