Path: utzoo!utgpu!watmath!clyde!att!pacbell!ames!ncar!gatech!hubcap!ncrcae!ncrlnk!uunet!mcvax!hp4nl!bebux!bert From: bert@bebux.UUCP (Bert Reuling) Newsgroups: comp.os.minix Subject: commands/test.c - bug + fix ???? Keywords: bugs test Message-ID: <1526@bebux.UUCP> Date: 10 Jan 89 22:46:10 GMT Reply-To: bert@bebux.UUCP (Bert Reuling) Organization: Betronic B.V. AMSTERDAM Netherlands Lines: 36 It seems I've found a bug in test(1) as distributed with MINIX-ST v.1.1. "test -eq " always returns false, even if == . Test without arguments returns non-zero, but prints a syntax error as well. I have tested test(1) on DYNIX (BSD4.2 and SV), HP-UX (SV) , v7 and SV/386. They all remain silent, but return non-zero. I don't know if this bug was reported earlier or if it applies to MINIX-PC as well. Anyway, here is the diff of the patch I made. 86,88c86,90 < prog = argv[0]; < ip = &argv[1]; < exit(!(expr(lex(*ip)) && *++ip == 0)); --- > if (argc == 1) > exit(1); > prog = argv[0]; > ip = &argv[1]; > exit(!expr(lex(*ip))); ...!hp4nl!bebux!bert / / Bert Reuling /-, ,--, ,-, /- p/a Radio Holland bv / / /--- / / Jan Rebelstraat 20 `-' `-- ` `-- 1069 CC Amsterdam The Netherlands MINIX werkgroep UNIXgg/HCC