Bug in /bin/test in 4.2 (with fix).
Stephen J. Muir
stephen at comp.lancs.ac.uk
Thu Aug 7 09:42:45 AEST 1986
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 at 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
More information about the Comp.bugs.4bsd.ucb-fixes
mailing list