Bug 474434 - syntax error w/ "expr" command using negative leading zero (i.e -05)
syntax error w/ "expr" command using negative leading zero (i.e -05)
Status: CLOSED RAWHIDE
Product: Fedora
Classification: Fedora
Component: coreutils (Show other bugs)
rawhide
All Linux
low Severity medium
: ---
: ---
Assigned To: Ondrej Vasik
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2008-12-03 15:11 EST by eric magaoay
Modified: 2008-12-03 18:05 EST (History)
3 users (show)

See Also:
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: ---


Attachments (Terms of Use)

  None (edit)
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.

Note You need to log in before you can comment on or make changes to this bug.