From mboxrd@z Thu Jan 1 00:00:00 1970 Date: Wed, 7 Feb 1996 04:21:26 -0500 From: Dave Presotto presotto@plan9.att.com Subject: mistakes in test(1) Topicbox-Message-UUID: 3b1d64b8-eac8-11e9-9e20-41e7f4b1d025 Message-ID: <19960207092126.Q8iRnDq1DbwcjzFkORXdsKWmFYencfrjnirOLQOd7t4@z> right you are. I fixed the CHDIR arbitrarily differently. Boddle is http://plan9.att.com/plan9/update/cmd/test.rc ------ forwarded message follows ------ >>From cse.psu.edu!9fans-outgoing-owner Wed Feb 7 10:17:09 EST 1996 Received: from colossus.cse.psu.edu by plan9; Wed Feb 7 10:17:09 EST 1996 Received: by colossus.cse.psu.edu id <78354>; Wed, 7 Feb 1996 09:56:25 -0500 Received: from hamnavoe.demon.co.uk ([158.152.225.204]) by colossus.cse.psu.edu with SMTP id <78352>; Wed, 7 Feb 1996 09:55:54 -0500 From: hamnavoe.demon.co.uk!miller To: cse.psu.edu!9fans Date: Wed, 7 Feb 1996 07:21:15 -0500 Subject: mistakes in test(1) Message-Id: <96Feb7.095554est.78352@colossus.cse.psu.edu> Sender: cse.psu.edu!owner-9fans Precedence: bulk Reply-To: cse.psu.edu!9fans I think there are two errors in the implementation of the test command, as shown by the following examples: if (test -d . -a ! -f .) echo OK if (test ! ! -d .) echo OK A suggested correction: diff /sys/src/cmd/test.c test.c 86c86 < return(!e3()); --- > return(!e2()); 193c193 < return(dir.mode&CHDIR); --- > return((dir.mode&CHDIR)!=0); -- Richard Miller 18 Lathbury Road, Oxford OX2 7AU, England