Bug 474434

Summary: syntax error w/ "expr" command using negative leading zero (i.e -05)
Product: [Fedora] Fedora Reporter: eric magaoay <ericm24x7>
Component: coreutilsAssignee: Ondrej Vasik <ovasik>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: low    
Version: rawhideCC: kdudka, ovasik, twaugh
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2008-12-03 18:05:32 EST Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Description eric magaoay 2008-12-03 15:11:38 EST
Description of problem:
I'm getting syntax error when evaluation expression with a leading negative zero number. Here is an example:

expr -05 \* 60 \* 60

However, the following will NOT have an error message:

expr 05 \* 60 \* 60
expr -5 \* 60 \* 60

NOTE: F10 release (coreutils.x86_64 6.12-17.fc10) does not have problem evaluating the above arithmetic expressions. 

FYI: in case one needs to figure out where -05 comes from, it is the local timezone output

date +%:::z

Version-Release number of selected component (if applicable):
coreutils.x86_64 7.0-3.fc11
expr --version => 7.0

How reproducible:
persistent

Steps to Reproduce:
1. from command line console, execute:
 
    expr -05  \*  60  \*  60

Actual results:
sysntax error

Expected results:
-18000
Comment 1 Ondrej Vasik 2008-12-03 18:05:32 EST
Thanks for report, it is not only for leading zeroes... It was caused by adding --bignum and --no-bignum options to coreutils-7.0 release. Bad handling caused, that only negative strings/integers to string length 2 were allowed on the first place of argument. Upstream recently removed those options, so I did the same thing. Fixed and built as coreutils-7.0-4.fc11, closing RAWHIDE.