Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!watmath!clyde!caip!lll-crg!seismo!mcvax!ukc!dcl-cs!stephen From: stephen@comp.lancs.ac.uk (Stephen J. Muir) Newsgroups: net.bugs.4bsd Subject: Bug in /bin/test in 4.2 (with fix). Message-ID: <341@comp.lancs.ac.uk> Date: Wed, 6-Aug-86 19:42:45 EDT Article-I.D.: comp.341 Posted: Wed Aug 6 19:42:45 1986 Date-Received: Sat, 9-Aug-86 08:23:47 EDT Reply-To: stephen@comp.lancs.ac.uk (Stephen J. Muir) Organization: Department of Computing at Lancaster University, UK. Lines: 51 Index: bin/test.c 4.2 [Fix] Description: The "-a" and "-o" operators in the "test" command do not work when the left-hand expression is a single argument. Repeat-By: Issue the command "test 1 -a 1". Fix: *** test.c.orig Wed Aug 6 22:30:04 1986 --- test.c Wed Aug 6 22:31:15 1986 *************** *** 107,113 return(EQ(nxtarg(0), "")); p2 = nxtarg(1); ! if (p2==0) return(!EQ(a,"")); if(EQ(p2, "=")) return(EQ(nxtarg(0), a)); --- 107,114 ----- return(EQ(nxtarg(0), "")); p2 = nxtarg(1); ! if (p2==0 || EQ(p2,"-a") || EQ(p2,"-o")) { ! ap--; return(!EQ(a,"")); } if(EQ(p2, "=")) *************** *** 109,114 p2 = nxtarg(1); if (p2==0) return(!EQ(a,"")); if(EQ(p2, "=")) return(EQ(nxtarg(0), a)); --- 110,116 ----- if (p2==0 || EQ(p2,"-a") || EQ(p2,"-o")) { ap--; return(!EQ(a,"")); + } if(EQ(p2, "=")) return(EQ(nxtarg(0), a)); -- EMAIL: stephen@comp.lancs.ac.uk | Post: University of Lancaster, UUCP: ...!mcvax!ukc!dcl-cs!stephen | Department of Computing, Phone: +44 524 65201 Ext. 4120 | Bailrigg, Lancaster, UK. Project:Alvey ECLIPSE Distribution | LA1 4YR