Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!watmath!clyde!burl!ulysses!bellcore!decvax!decwrl!sun!guy From: guy@sun.UUCP Newsgroups: net.bugs.usg,net.bugs.4bsd,net.bugs.v7,net.bugs.2bsd Subject: Re: expr(1) fails on negative arguments (with fix) Message-ID: <4143@sun.uucp> Date: Sat, 14-Jun-86 17:27:30 EDT Article-I.D.: sun.4143 Posted: Sat Jun 14 17:27:30 1986 Date-Received: Tue, 17-Jun-86 22:00:30 EDT References: <270@cirl.UUCP> <219@decvax.UUCP> <2795@pegasus.UUCP> Distribution: net Organization: Sun Microsystems, Inc. Lines: 15 Xref: watmath net.bugs.usg:504 net.bugs.4bsd:2168 net.bugs.v7:233 net.bugs.2bsd:371 > < Nice fix. Try "expr -5 * ---6". The problem cannot be correctly fixed > < w/out going all out and implementing UMINUS is the yacc grammar. Any > < takers? > (fixed in S5) Sorry, but I haven't looked at the expr code to see what > the real fix was. It may have been to rewrite the whole thing in C. It had been so rewritten as of S3, although the S3 version still maintained the old "index", "substr", and "length" operators from V7, which were undocumented and caused confusion if those names appeared as operands. S5 ripped them out. -- Guy Harris {ihnp4, decvax, seismo, decwrl, ...}!sun!guy guy@sun.com (or guy@sun.arpa)