bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: ./expr 6 + -2 => 8


From: Jim Meyering
Subject: Re: ./expr 6 + -2 => 8
Date: Thu, 26 May 2005 18:01:44 +0200

"Dr. David Alan Gilbert" <address@hidden> wrote:
>   From the current cvs (as of a few minutes ago) when I do
>
> ./expr 6 + -2
>
> I get 8.  Every other version of expr I've tried gets 4
> which really does seem right.
>
> (This is on ubuntu Linux gcc 3.3.5 on x86)
>
> Can anyone replicate this?

I can :(
Thanks for the report.

Here's a snap fix.
I'll add tests, too.

Index: expr.c
===================================================================
RCS file: /fetish/cu/src/expr.c,v
retrieving revision 1.102
diff -u -p -r1.102 expr.c
--- expr.c      14 May 2005 07:58:37 -0000      1.102
+++ expr.c      26 May 2005 16:00:27 -0000
@@ -356,7 +356,7 @@ toarith (VALUE *v)
        while (*++cp);
 
        free (v->u.s);
-       v->u.i = value * sign;
+       v->u.i = value;
        v->type = integer;
        return true;
       }




reply via email to

[Prev in Thread] Current Thread [Next in Thread]